This page displays the results of a collection of shell scripts and rrdtool commands
used to track server statistics. Click any graph to see it in much greater detail.
Handling Time Axis
One challenge encountered while making these graphs is getting each pixel along the
x-axis to represent an exact, constant amount of time and keep the graph size roughly around
600-800 pixels. I did this as follows:
- Choose a view, for example the 1-day history. Find the actual number
of days (1).
- Find the number of seconds associated with the view (86400).
- Find the equivalent number of 5-minute samples (288).
- If we have few enough samples for a reasonably-sized graph, we
have a ratio of 1 Primary Data Point for every 1 archived datapoint,
so the database size stays the same (288). If the number of
PDPs is still huge, we will need to increase the ratio to scale down the archive size.
- In any archive, the data associated with the last time stamp will be undefined.
Make the archive hold one extra sample that will be empty (total size of 289).
When pulling information from the archive, do not poll the very last value.
- When graphing, scale the result in step 4 up if necessary
(factor of 2 in this case) for
a graph of reasonable size (576 pixels).
- Every pixel along the x-axis will represent the same exact amount of time,
derived from dividing the total time by graph size (86400/576 or 2.5 minutes in this case).
Applying the above to other views, we get:
| Step | Day View | Week View | 2-month View | Year View |
| 1 | 1 | 7 | 60 | 364 |
| 2 | 86400 | 604800 | 5184000 | 31449600 |
| 3 | 288 | 2016 | 17280 | 104832 |
| 4 | 1:1 288 | 3:1 672 | 24:1 720 | 144:1 728 |
| 5 | 289 | 673 | 721 | 729 |
| 6 | *2 576 | *1 672 | *1 720 | *1 728 |
| 7 | 2.5 min | 15 min | 2 hr | 12 hr |
Views
Generally, each graph has four views: one for each of the periods covering the last day, the last week,
the last two months, and the last year. Many graphing tools use views for the last hour, and for the
last month. I chose not to do an hour view because the data sampling rate is 5 minutes and therefore
is shown in full resolution on the day view. I chose to show two months instead of one because the time multipliers
between views would be a more consistent 7,8,6 instead of 7,4,12. The thumbnail is usually a scaled-down version
of the daily view.
Pseudorandom Related Data
... is located here
|