I've had an issue since upgrading my distro a couple of weeks ago from hardy; receiving data after making a request has increasing intervals of nothing, as you can see from the picture below.


I have since reinstalled fresh from an Ubuntu 10.04 Server (i386) disk, but am still having the same issues. I'm running on a LigHTTPd, MySQL, PHP5 stack. The surprising thing is, that local browsing using lynx is super fast, as expected. Initially, after reinstalling, I copied over the old configuration files from the previous installation, but have since reinstalled LigHTTPd and rebuilt the config file from scratch. The only correlation I could find, was that I attempted installation of ionCube and Zend Optimizer for a script I was testing, however I would think that it could no longer impact seeing I had reinstalled the OS. I have also removed Suhosin just in case, however it had no impact.

I'm thinking it possibly has something to do with networking, but I wouldn't know where to start. The server is manually assigned an IP by it's MAC address on the router.

The fact that the time seems to be exponential (to a point) worries me. I've tried strace'ing the LigHTTPd and MySQL processes, however I couldn't see anything obvious, not that I'd really know what I'm looking for. RAM and CPU usage don't seem to be out of the ordinary, but I can't say its perfect..

I'm hoping someone has experienced the same, or can point me in a direction, as searching has proved fruitless as I don't know anything specific. Config files can be posted, if requested.

migrated from superuser.com Sep 24 '10 at 23:24

This question came from our site for computer enthusiasts and power users.


Check "ufw", iptables, AppArmor. (You can disable ufw by sudo service ufw stop)

Oh and /etc/resolv.conf (for dns) and /etc/hosts . You have to type the own machine name there like (or just paste yours to http://pastebin.com , paste the link and I'll check it): localhost MyMachine

  • Hi, thanks for your suggestions. After running sudo ufw disable and sudo service ufw stop there didn't seem to be any difference. sudo iptables --list returns empty. resolv.conf contains: nameserver, which is the IP address of my router. /etc/hosts did not have an entry for my LAN IP, so I added one, with similar details to localhost: pastebin.com/DPfCtijQ I obviously restarted networking and LigHTTPd after all this, still no go. I have blacklisted ipv6 in modeprobe.d for extra measure and am going to try see what happens after a reboot. – ctrl_freak May 23 '10 at 7:08
  • pastebin.com/Q8n0d3eD | Just a try though. – Shiki May 23 '10 at 7:25
  • I changed the hosts file to your suggestion, but no luck unfortunately. I also removed AppArmor. Again, thanks for your help. Any other suggestions? Or any ways to narrow down where the issue may be coming from? – ctrl_freak May 23 '10 at 8:02
  • When you login from SSH does is it log you in instantly? If not its about resolv or something. If yes, then maybe you can try upgrading to a newer lighttpd / mysql(?) from the lighttpd site. – Shiki May 23 '10 at 8:18
  • Yes, I have the issue when I log in locally through SSH that it takes a long time to ask for my password. I'll try installing bind and go through the solution for the SSH issue to see if it sorts this out. However, I don't think getting the latest versions of LigHTTPd or MySQL will help, as through lynx on the local machine, it is perfectly fine. – ctrl_freak May 23 '10 at 10:07

From the thread Lighttpd/PHP (FastCGI) Server Extremely Slow

the solution was to use spawn-fcgi and increase the php-cgi count to 32

(Please note that as a particularity of experts-exchange.com, you can't access directly the article. You must instead do so through this google request.)

  • It seems that my problem is increasingly being traced to a problem outside of my webserver and PHP. As shown on Can Burak Cilingir's comment, the script execution time is fast, as well as local browsing with lynx. I doubt this will help, but I'm getting desperate, so I'll give it a shot. – ctrl_freak Sep 22 '10 at 14:00
  • So if I'm reading correctly, to use spawn-fcgi I need to update to lighttpd 1.5? I can't seem to find any instructions on how to do it with anything 1.4.x. – ctrl_freak Sep 22 '10 at 15:10
  • On versions < 1.4.23 it is installed automatically. On newer versions it's a separate package living at: redmine.lighttpd.net/projects/spawn-fcgi. – harrymc Sep 22 '10 at 15:31

Can you please print a timestamp to syslog at the beginning of the php script and at the end and be sure that the script execution time is constant and not increasing.

  • And, why don't you test with lighthttp 1.4.28. You seem to use .19 – Can Burak Çilingir Sep 21 '10 at 9:36
  • Here are the timestamps. They're before and after a phpinfo(). Sep 22 21:36:18 ctrl-freak php5-cgi: Start Script: Wed, 22 Sep 10 21:36:18 +0800, 0.92783400 1285162578 and Sep 22 21:36:18 ctrl-freak php5-cgi: End Script: Wed, 22 Sep 10 21:36:18 +0800, 0.93090000 1285162578. This confirms how local browsing with lynx is super fast, as it should be. – ctrl_freak Sep 22 '10 at 13:51
  • Strangely enough, while running an apt-get upgrade to see if it would upgrade lighttp, it updated apache2 (which I didn't think I had installed) and started it before lighttpd. Browsing the same php script, the execution time is the same, but the page is displayed at an expected speed. I'll give harrymc's suggestion a shot. – ctrl_freak Sep 22 '10 at 14:23
  • Installed lighttpd-1.4.28 from source, got running, however the same problem is evident. – ctrl_freak Sep 22 '10 at 14:56

Hi can you post the configuration of your lighttpd virtual host file that way we can have a look at the configuration.If it is reverse proxy etc type of situation. Some times these type of issues can come from such files also.Use tcpdump to analyze where the traffic on this machine is going.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy