<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Infinitus Incognita &#187; postgresql</title>
	<atom:link href="http://jaredwatkins.com/wordpress/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaredwatkins.com/wordpress</link>
	<description>I don&#039;t build to have clients. I have clients in order to build.</description>
	<lastBuildDate>Mon, 07 May 2012 21:11:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What I Do &#8211; Broadsoft CDR Files to Radius Accounting Records</title>
		<link>http://jaredwatkins.com/wordpress/2012/02/what-i-do-broadsoft-cdr-files-to-radius-accounting-records/</link>
		<comments>http://jaredwatkins.com/wordpress/2012/02/what-i-do-broadsoft-cdr-files-to-radius-accounting-records/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 03:40:17 +0000</pubDate>
		<dc:creator>JaredWatkins</dc:creator>
				<category><![CDATA[Computing and Tech]]></category>
		<category><![CDATA[My Code]]></category>
		<category><![CDATA[broadsoft]]></category>
		<category><![CDATA[cdr]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[resume]]></category>
		<category><![CDATA[soft switch.radiator]]></category>

		<guid isPermaLink="false">http://jaredwatkins.com/wordpress/?p=675</guid>
		<description><![CDATA[As part of a larger project I needed to generate real time radius records from the CDR accounting files of several cluster pairs of Broadsoft application servers. So I wrote a perl script to do just that. It maps the CDR fields to radius attribs and encodes the accounting packet using the Net::Radius::Packet CPAN module. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2012/02/perl.jpg"><img class="alignleft size-thumbnail wp-image-680" title="perl" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2012/02/perl-150x150.jpg" alt="" width="150" height="150" /></a>As part of a larger project I needed to generate real time <a href="http://en.wikipedia.org/wiki/RADIUS">radius</a> records from the CDR accounting files of several cluster pairs of <a href="http://www.broadsoft.com/">Broadsoft</a> <a href="http://www.broadsoft.com/products/broadworks/platform/">application servers</a>. So I wrote a perl script to do just that. It maps the CDR fields to radius attribs and encodes the accounting packet using the <a href="http://search.cpan.org/~luismunoz/Net-Radius-2.103/Radius/Packet.pm">Net::Radius::Packet</a> CPAN module.  In my case I&#8217;m using the <a href="http://www.open.com.au/radiator/">Radiator radius server</a>  from <a href="http://www.open.com.au/">OSC Software</a> on the other end with lots of custom &#8216;hook code&#8217; to clean up and store the call data coming off our network into a <a href="http://www.postgresql.org/">Postgresql</a> database.  This is my first time doing any development with radius.. but I&#8217;ve been running this script on several servers for a few weeks now and it appears to be quite stable.</p>
<ul>
<li>Get it on the <a href="http://jaredwatkins.com/wordpress/my-projects/file2radius/">Project Page</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jaredwatkins.com/wordpress/2012/02/what-i-do-broadsoft-cdr-files-to-radius-accounting-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I do &#8211; Dynamic Daily Table Partitions With Postgres</title>
		<link>http://jaredwatkins.com/wordpress/2012/01/what-i-do-dynamic-daily-table-partitions-with-postgres/</link>
		<comments>http://jaredwatkins.com/wordpress/2012/01/what-i-do-dynamic-daily-table-partitions-with-postgres/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 21:00:13 +0000</pubDate>
		<dc:creator>JaredWatkins</dc:creator>
				<category><![CDATA[Computing and Tech]]></category>
		<category><![CDATA[Geeky Stuff]]></category>
		<category><![CDATA[My Code]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[partitions]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[resume]]></category>
		<category><![CDATA[rolling]]></category>
		<category><![CDATA[sliding]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://jaredwatkins.com/wordpress/?p=549</guid>
		<description><![CDATA[As part of a new and fairly large project I have a need to partition a few postgres tables and have a rolling daily window.  That is.. I want to organize data by a timestamp storing each day in its own partition and maintain 90 days of historical data.  Doing this is possible in Postgresql [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft  wp-image-581" title="postgres_elephant" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/12/postgres_elephant-150x150.png" alt="" width="90" height="90" />As part of a new and fairly large project I have a need to partition a few postgres tables and have a rolling daily window.  That is.. I want to organize data by a timestamp storing each day in its own partition and maintain 90 days of historical data.  Doing this is possible in Postgresql but it&#8217;s not pretty or very clean to set it up.  To simplify the process I wrote this perl script that (when run daily) will pre-create a certain number of empty partitions into the future and remove the oldest partitions from your window.</p>
<p>The script is generalized so as to be easy to modify and there isn&#8217;t much here that&#8217;s specific to postgres.. so it could easily be adapted for use with other systems like Oracle. You will need to put in the DDL for the child tables you will create but otherwise it&#8217;s pretty straight forward.  Please let me know if you find this useful as I couldn&#8217;t find anything else out there like it.</p>
<p>Visit the <strong><a title="pgDynamicPartitions" href="http://jaredwatkins.com/wordpress/my-projects/pgdynamicpartitions/">project page</a></strong> for details and the download.</p>
<p>Update: Several important updates to the code and my examples since I first published this.  Be sure to grab the latest version which is starting to behave reasonably now.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredwatkins.com/wordpress/2012/01/what-i-do-dynamic-daily-table-partitions-with-postgres/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I do &#8211; Practical Data Visualization</title>
		<link>http://jaredwatkins.com/wordpress/2011/03/what-i-do-practical-data-visualization/</link>
		<comments>http://jaredwatkins.com/wordpress/2011/03/what-i-do-practical-data-visualization/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 03:01:48 +0000</pubDate>
		<dc:creator>JaredWatkins</dc:creator>
				<category><![CDATA[Computing and Tech]]></category>
		<category><![CDATA[Geeky Stuff]]></category>
		<category><![CDATA[My Code]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[data Visualization]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[jpgraph]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mirapoint]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[reporting]]></category>
		<category><![CDATA[resume]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[trend]]></category>
		<category><![CDATA[trending]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://jaredwatkins.com/wordpress/?p=447</guid>
		<description><![CDATA[I&#8217;m often ask what it is I do for a living&#8230; and being lazy I usually just say &#8216;computer stuff&#8217;.   In an effort to provide a little more context to anyone who may be interested this is one in a series of postings where I&#8217;ll cover some aspect of what it is I do. In [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m often ask what it is I do for a living&#8230; and being lazy I usually just say &#8216;computer stuff&#8217;.   In an effort to provide a little more context to anyone who may be interested this is one in a series of postings where I&#8217;ll cover some aspect of what it is I do.</p>
<p>In my current role I spend part of the time doing development projects. (aka programming) I&#8217;m not a hard core developer though.. it&#8217;s not my full time occupation nor do I want it to be.  I work mostly with <a href="http://www.perl.org/">perl</a> and <a href="http://www.php.net/">php</a> when necessary, <a href="http://www.mysql.com/">mysql</a> and occasionally <a href="http://www.postgresql.org/">PostgreSQL</a> or <a href="http://www.oracle.com">Oracle</a> all under various flavors of linux. (<a href="http://www.debian.org/">debian</a> is my favorite). Usually these development tasks are related to some sort of management automation for a global VoIP network but sometimes they involve making complex things easier to understand.  Part of that involves automating the collection of large amounts of data and then presenting in a meaningful way so that problems and long term trends can be identified.  What follows are some examples of the sorts of things I mean.</p>
<p><span id="more-447"></span></p>
<p><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis6.png"><img class="alignleft size-thumbnail wp-image-446" title="datavis6" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis6-150x150.png" alt="" width="150" height="150" /></a>I was once tasked with redistributing users on a farm of several <a href="http://www.mirapoint.com/">large mail servers</a> to better balance performance.  This meant I needed to quantify how much impact each user (or group of users in this case) was having on the system in order to come up with a plan to fix the imbalances.  This was not an easy task as there was no way to get direct measurements of that sort of thing.  So.. operating on a &#8216;best effort&#8217; approach I wrote some code to scour the mail server logs going back several weeks and gather stats on the number of messages sent/received, size of said messages, combined size of the mail store for the groups of customers etc. I was then able to plot this info in different ways and figure out who the heavy hitters were.  There were some surprises.. as some had little saved on the server but moved a ton of bytes through the system.</p>
<p>&nbsp;</p>
<p><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis5.png"><img class="alignleft size-thumbnail wp-image-445" title="datavis5" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis5-150x150.png" alt="" width="150" height="150" /></a><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis4.png"><img class="alignleft size-thumbnail wp-image-444" title="datavis4" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis4-150x150.png" alt="" width="150" height="150" /></a>Another project called for the automation of several reports that upper management wanted to see from our engineering group.  Unlike say sales or marketing.. it can be difficult to quantify the things we do in any sort of meaningful way.  I was able to pull together lots of reporting data though on operational aspects of the network and the customer devices we have in the field.  To make this as hands off (for us) as possible I wrote a database backed template system that allowed those on the top floor to choose from a range of reports with custom date ranges and generate either downloadable spreadsheets or in some cases fancy dynamic graphs. These example images show the same data set sorted different ways for a certain point in time and were created with the <a href="http://jpgraph.net/">JpGraph php library</a>.   These graphs can also be combined to show a running animation of how things change over a period of months or years. This was the front end for data that was collected from several different (and incompatible) systems and distilled down to reports that anyone could make sense of.</p>
<p><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis2.png"><img class="alignleft size-thumbnail wp-image-442" title="datavis2" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis2-150x150.png" alt="" width="150" height="150" /></a><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis3.png"><img class="alignleft size-thumbnail wp-image-443" title="datavis3" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis3-150x150.png" alt="" width="150" height="150" /></a>One of my primary tasks in my current role is to build and run the <a href="http://nagios.org/">network monitoring system</a>. This is done with all open source software that is very powerful and very flexible. I&#8217;m constantly developing new aspects of the system to customize it to the needs of a growing VoIP carrier network. These are two examples of the sorts of server level stats we collect on nearly all the systems being monitored.  The first is a long term trend plot of a <a href="http://en.wikipedia.org/wiki/Load_%28computing%29">system load</a>.  The second is a weekly plot of what the<a href="http://en.wikipedia.org/wiki/CPU_usage"> CPU was spending time on</a>.  This sort of information is great for forensic troubleshooting (ie <a href="http://en.wikipedia.org/wiki/Root_cause_analysis">root cause analysis</a>) and for capacity planning. In addition to CPU usage we also track memory usage, process counts, service response times, bandwidth usage, database query performance, and the network <a href="http://en.wikipedia.org/wiki/Border_Gateway_Protocol">BGP</a> mesh status. Some stats are just trended some are trended with threshold alarms including some rate of change alarms that are very responsive to service problems.</p>
<p><a href="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis11.png"><img class="alignleft size-thumbnail wp-image-456" title="datavis1" src="http://jaredwatkins.com/wordpress/wp-content/uploads/2011/03/datavis11-150x150.png" alt="" width="150" height="150" /></a>This last example is the most recent.  In addition to telecom the company also deals with a small but growing number of DSL customers which require us to manage and maintain the backend network that connects these users to the internet.  Without getting too technical.. the backend router has several gigabit circuits from the &#8216;last mile&#8217; provider  that converge into a set of redundant routers in our CoLo. Over time.. these feeder circuits can become imbalanced and blocks of users must be moved to other circuits. We also need to keep track of overall circuit usage so we know when more circuits (which are quite expensive) will be needed.  So..  tactically we need to know what&#8217;s happening on the circuits in a very high resolution view tracking both peaks of individual circuits and aggregate bandwidth and strategically we need to know if those peaks are trending up or down over a period of months. This info along with active customer counts and average usage-per-customer can be relayed back to sales for their trending and pricing.  Since this is new I don&#8217;t have a useful peaks graph yet.. but this is an idea of the tactical data referenced for circuit balancing and circuit addition.  This data is collected with snmp in 1 minute increments and stored in an <a href="http://www.mrtg.org/rrdtool/">RRD database</a> that is setup to keep two sets of data for this trending.  One dataset contains every 1 minute sample for a period of 7 days.  As the data ages beyond 7 days it flows into the second set.  It examines a 24 hour period and stores only the peak values for that day and those data points are saved for 5 years for long term trending.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredwatkins.com/wordpress/2011/03/what-i-do-practical-data-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

