Varnish dashboard

Posted by on Apr 2, 2014 in Server Monitoring, Varnish | 2 Comments
Varnish dashboard

I decided to write a quick something to give me a overview of the status of Varnish which I intend to build upon.  Currently what I have put together is a overview page which will show me the following:

  • Status of the websites that are managed by the instance
  • Cache hit ratio for the varnish instance
  • The CPU/Memory/Disk space status of the varnish server
  • Some varnishstats
  • Historical chart of the Cache hit ratio
  • The details of the VCLs that are loaded into varnish
  • The latest hits against varnish and there details e.g. hit/miss, source, URL etc
  • The current ban list

I decided that I would write a restful interface to gather the various bits of information and some cron jobs which would store historical information into a mysql database.

The details all can by dynamically refreshed via AJAX calls to the restful interface that I created to gather the stats.  I currently have the CPU,Memory and disk stats updating every 30 seconds and the historical hourly hit ratio chart updating every minute.  The other elements can all by refreshed by a refresh button.

Website status

The following is the details of the website checks, this just does a curl to get the website to make sure it is responding.  When the website is being checked the circle is amber, when it is down it is red and when it is up it is green.

website status repot

website status repot

Varnish server status

The following are the Varnish stats, the colour of the CPU, Memory and Disk change depending on the thresholds that  have been set, based on a Red, Amber and Green colour.

Varnish server stats

Varnish server stats

Varnishstats

The following is the details collected from varnishstat for some elements that I was interested in:

Varnishstats

Varnishstats

Varnish historical hit ratio

The following historical hit ratio chart is created by the data collected every minute by cron and put into a database, I am planning on putting a selection to change the range of the dates collected and probably put in a zoom, so if you collect a large date range you can zoom in.

Historical varnish hit ratio

Historical varnish hit ratio

Varnish hits

The following is the latest hits to varnish.  I have varnishncsa running as a daemon storing the hit details into a file which is then queried by the backend restful interface.

Latest varnish hits

Latest varnish hits

Varnish ban list

The following is the current ban in varnish, not really sure that I need to see this so this may well go in a future version.

Varnish ban list

Varnish ban list

Varnish VCLs

The last part of the dashboard is the varnish VCLs that are configured.  It will show all the VCLs and which one is active, I plan on putting a button to either upload a new VCL or change which VCL is active.

VCL details

VCL details

I have also created a interface into google analytics so that I can pull information about the visitor count etc from there to overlay with the stats that I have from varnish.  I will also do some processing on the file that I’m capturing from varnishncsa so that I can collect more details about the response times for URLs, hits against URLs etc.  This will then all be uploaded to the Database every hour.  I’ll put some more posts on with some more details about the backend part of this.

The whole interface is based on twitters bootstrap so is mobile friendly as well.  The restful interface that I decided upon was using slim micro framework.

2 Comments

  1. Pierre-Yves
    April 10, 2014

    Hi,
    Where could I find this dashboard ? Is it a free software ?
    Thanks by advance.
    Best Regards

    Reply
    • james
      April 11, 2014

      It is just something that I’m writing for a bit of fun and to play with a few different technologies. When I have it in a bit more of a finished state I’ll put it on github for anyone to have a look at.

      Reply

Leave a Reply