Unix Realtime Performance Charts

This page is still under construction, if anything is missing or unclear send me a and I'll get in touch.

Introduction

The /etc realtime charting system is a free, lightweight mechanism for generating Unix and Linux performance charts. The client reads the performance data direct from the kernel and sends updates across the network to a centralised charting server which generates the .bmp files.

The .bmp files are best displayed on a web page where, as they are only 340x150, it is possible to display 12 of them using 1024x768 resolution.

Displaying the charts this way has the following advantages:

  • HTML is a well known programming language
  • No viewing software required other than a browser with JavaScript
  • JavaScript allows dynamic code to be included on the page
  • HTML supports auto-refreshing of pages
  • The same chart can appear on many pages, even on externally hosted sites
  • Bitmaps can be displayed smaller than actual size
  • Users can copy charts direct from the browser for use in emails etc

    The current version of rtc will generate two charts: a 24hr CPU chart and a 24hr memory chart (excluding swap). Each x position represents a 5 minute period. Owing to the different figures available for Solaris and Linux, the various clients generate different charts.

    The charts bitmaps have the following characteristics

  • The are bitmaps so recognised by all graphic packages
  • They only support 16 colours to limit the file sizes
  • The bitmaps are compressed using Run Length Encoding (RLE)
  • The charting engine is optimised for efficient updates
  • Updates are sent as UDP messages, so have a low network overhead
  • The client processes can redraw a chart if updates get lost
  • The chart is stored off the host machine
  • Updates can be send to multiple charting servers for resilience
  • Charts are datestamped so a history is automatically kept
  •   Solaris CPU chart Green=user, Yellow=sys, Blue=I/O wait Solaris Memory chart Green=free RAM

    Client & Daemon Setup

    First you will need a Solaris or Linux machine with a web server. The charting daemon (rtcd) is installed on this machine (e.g. /opt/charts/bin/rtcd). If you haven't got a Unix webserver try installing Apache.

    Next, start the daemon thus: /opt/charts/bin/rtcd -d directory, where directory is the target location for the charts. I'd suggest starting the daemon as the user sys (or adm on Linux) as sar runs as this user. It is best not to start it as root as it provides a incoming network port (6287 as default, changeable via the -p option).

    Next, install the client software (rtc) on each client machine; e.g. /opt/charts/bin/rtc. Start the rtc process (as sys or adm preferably) but you will need to specify the server machine via the -c machine option. If the daemon was started on a different port to 6287, use -c machine:port. Rtc can send to two seperate daemons, just specify two -c options.

    To check that updates are being received buy the daemon, start it with the -t option. This means it will print all updates on the stderr. The output directory will contain the actual .bmp files.

    Building a Web Page
    As the charts are datestamped, the web page has to be able to generate the filenames to include the current date. The JavaScript function datestamp() is provided in the functions.js file. An example page can be found here as a text document.

    Housekeeping
    This system will generate two charts per client per day each of around 10k. In order to limit the amount of disk space these can comsume a cron job should be setup to clear down charts older than 30 days or how long you want.

    Future Enhancements
    Depending on take-up and feedback I will be expanding the chart capabilities to monitor, for example, run queue, paging, network etc. If nobody seems to be using the charts they are likely to remain as they are.

    Other features of future revisions will include:

  • the ability to save updates locally for multi-day redraws
  • better diagnostics and error handling for corrupted charts
  • user defined charts