The round-robin database tool aims to handle time-series data like network bandwidth, temperatures, CPU load etc. The data gets stored in round-robin database so that system storage footprint remains constant over time. Lighttpd comes with mod_rrdtool to monitor the server load and other details. This is useful for debugging and tuning lighttpd / fastcgi server performance.

Install rrdtool

Type the following command if you are using CentOS / RHEL / Fedora Linux (enable EPEL repo):
# yum install rrdtool
If you are using Debian / Ubuntu Linux, enter:
# apt-get update && apt-get install rrdtool

Configure mod_rrdtool

You need to use /usr/bin/rrdtool binary file. Open the lighttpd configuration file, enter:
# vi /etc/lighttpd/lighttpd.conf
Add the following:

server.modules              += ( "mod_rrdtool"  )
### RRDTOOL Config
# path to the rrdtool binary
rrdtool.binary = "/usr/bin/rrdtool"
# rrd database file
rrdtool.db-name = "/home/lighttpd/rrd"

Save and close the file. Now gracefully reload lighttpd webserver:
# service lighttpd reload
/home/lighttpd/rrd is a filename of the rrd-database. Make sure that /home/lighttpd/rrd doesn’t exist before the first run, as lighttpd has to create the DB for you.

How Do I View Graphs?

You need to download and install cgi script. My cgi-bin directory is located at /home/lighttpd/cgi-bin/ (see how to configure cgi-bin CGI access under Lighttpd):
$ cd /home/lighttpd/cgi-bin/
$ wget
$ chmod +x lightygraph.cgi

Open the web browser and type url:
Sample graphs:

Fig.01: Lighttpd WebServer Statistics For Last 4 Hours

Fig.01: Lighttpd WebServer Statistics For Last 4 Hours

Fig.02: Lighttpd WebServer Statistics - Daily Graphs

Fig.02: Lighttpd WebServer Statistics - Daily Graphs

๐Ÿง Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

๐Ÿง 13 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
13 comments… add one
  • RobertRade May 24, 2009 @ 11:50


    I use perl lightygraph.cgi to validate the results. Unfortunately, the lightygraph.cgi is broken due to the old perl module. Check out here:

    The details on RRDTool for Lighttpd can be found here:

    I appreciate that you’re trying to let us know of the RRDTool. Next time, try to validate the results first before posting here. ๐Ÿ™‚



    • ๐Ÿง nixCraft May 24, 2009 @ 11:59

      It is working here w/o any problem. Tested on RHEL 4.x and 5.3:
      lighttpd -v
      lighttpd-1.4.22 (ssl) – a light and fast webserver
      Build-Date: May 7 2009 11:37:00

      perl -v | grep built
      This is perl, v5.8.8 built for x86_64-linux-thread-multi

      rrdtool info| grep RRD
      RRDtool 1.2.27 Copyright 1997-2008 by Tobias Oetiker

      I don’t post anything without testing ๐Ÿ˜‰


    • Rogerborg Mar 24, 2015 @ 21:46

      The far future salutes you, and suggests:

      sudo apt-get install librrds-perl

  • Samim Jun 10, 2009 @ 6:53

    Hi Vivek,

    Thanks for writing this nice document. I followed your steps. I am able to run sample perl script w/o any problem.
    But when ever I tried to access lightygraph.cgi page download pop-up windows comes for downloading. Then I made some changes in lighttpd.conf for accessing .cgi pages now its saying “403 Forbidden”. My rrdtool is in /usr/local/bin/rrdtool.
    Also, there is no file for rrd-db.

    Pls. let me know if u have any suggession.


    • ๐Ÿง nixCraft Jun 10, 2009 @ 7:13

      Can you paste or upload your lighttpd somewhere else?

  • Samim Jun 10, 2009 @ 7:37

    Hi Vivek,

    Thanks for reply. Pls. follow the below link where I paste my entire conf file.

  • johan Dec 26, 2009 @ 2:59

    Hi Vivek,

    Although i use Linux for many years, I never ‘stumbled’ over this website before.
    Better late than never! The best website about linux i’ve seen !!!!

    Thanks for all the effort you are putting into this site.

  • Alex Apr 2, 2010 @ 1:45

    This might seem a silly question. But what is the red data on the ‘TrafficWebserver’ graph? Are those errors, because they’re negative…


  • Dmitry Sherman Aug 11, 2010 @ 7:47

    i wonder if it is it possible to view traffic graphs per domain ? (“host”)
    since lighty knows how to limit bandwidth on particular host so i guess it also possible to retrieve this data somehow.

  • Derek Jul 3, 2012 @ 10:13

    if you are getting 503 errors check that the paths are correct in the .cgi file, mkdir as necessary

    you can test it from the linux command line as follows
    # perl lightygraph.cgi

    to fix the Can’t locate issue you can
    # yum install rrdtool-perl.x86_64

  • Sean A.O. Harney Feb 28, 2013 @ 16:29

    On CentOS do

    yum rddtool to install.
    then edit the lighttpd config.
    If lighttpd restarts and has following in error-log
    ERROR: creating ‘/var/lib/lighttpd/lighttpd.rrd’: No such file or directory

    You may have to
    cd /var/log/lighttpd.rrd
    touch ./lighttpd.rrd
    chown lighttpd.lighttpd ./lighttpd.rrd

  • Sean A.O. Harney Feb 28, 2013 @ 16:33

    On CentOS do

    yum rddtool # to install.
    /etc/initd.d/rrdcached start
    Make sure it is in rc.scripts so it will start on bootup

    If lighttpd restarts and has following in error-log
    ERROR: creating รขโ‚ฌหœ/var/lib/lighttpd/lighttpd.rrdรขโ‚ฌโ„ข: No such file or directory

    You may have to

    cd /var/log/lighttpd
    touch ./lighttpd.rrd
    chown lighttpd.lighttpd ./lighttpd.rrd

  • JoBArTe_Skuld Jul 4, 2013 @ 3:36

    Is possible to set a rrdtool by much hostname? I have 5 hostnames in one lighttpd

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum