Lighttpd with wrong configuration?

Posted on 2008-11-15
Last Modified: 2013-12-16

I´m running a webserver with Lighttpd 1.4.20 (RPM) + PHP 5.1.6 (fastcgi + rpm) over Linux Centos 5.2 64 Bits in a Dell PowerEdge R200 server (Xeon Dualcore 3065, 4 GB RAM, 2X146 GB SAS 15.000 RPM) in a web site of Music (Flash players playing MP3 Files). It handles 170 Mbit of traffic with the following requests at this moment:

# netstat -an |grep :80 |wc -l

# netstat -an |grep :80 |grep TIME_WAIT |wc -l

* Some days, it achieves 4500-5500 petitions with a lot of Time Wait.

My configuration is the following:

server.modules              = (
                                "mod_accesslog" )
server.document-root        = "/var/www/goear/"
server.max-connections = 7000
server.max-fds = 21000
server.max-worker = 30
#server.max-request-size        = 30000
server.max-write-idle = 7200
server.max-read-idle = 10
server.max-keep-alive-requests = 0
server.max-keep-alive-idle = 0
#server.use-noatime = "enable"
server.event-handler = "linux-sysepoll" = "linux-sendfile"

fastcgi.server             = ( ".php" =>
                               ( "myip" =>
                                   "socket" => "/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" => "/usr/bin/php-cgi",
                                   "max-procs" => 10,
                                   "bin-environment" => (
                                     "PHP_FCGI_CHILDREN" => "16",
                                     "PHP_FCGI_MAX_REQUESTS" => "5000"

I got a lot of this errors and php-cgi zombie process:

2008-11-12 19:54:48: (mod_fastcgi.c.2956) backend died; we'll disable it for 5 seconds and send the request to another backend instead: reconnects: 0 load: 9
2008-11-12 19:54:48: (mod_fastcgi.c.2709) child died somehow, waitpid failed: 10

Some idea about of it?

Thanks in advance


Question by:admin112
    LVL 10

    Accepted Solution

    How much ram you using at the moment, is it swapping? How much is each lighthttpd process / child using? Are you trying to generate to many which is just dying.

    Is there any database activity? Could it be drying due to poorly optimized queries taking to long to return results?

    Sorry haven't had a good look over just heading out.

    Author Comment


    Now it is the usage:

      1  [###################*******************************100.0%]     Tasks: 394 total, 16 running
      2  [################**********************************100.0%]     Load average: 38.12 36.86 36.32
      Mem[||||||||||#***********************************692/3948MB]     Uptime: 2 days, 16:52:01
      Swp[|                                               6/1027MB]

    My configuration has changed a bit, however site is now even fast than before. I noticed that using a phpinfo.php is slow too, only HTML files are fast. SQL queries could be even more optimized, but Mysql is not using almost resources (is a Quad core box, 8 GB RAM).


    Author Comment

    My system was causing low performance due to a low parameter in readahead for raid´s (default of 256 in centos and rhel). Changing to the deadline elevator was also of help.

    Author Closing Comment

    thanks for your help

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now