0

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.

http://i49.tinypic.com/2w5lvr9.png

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.

4 Answers4

1

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):
127.0.0.1 localhost
192.168.1.101 MyMachine

Apache
  • 274
  • 6
  • 18
  • 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 10.1.1.1`, 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: http://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. –  May 23 '10 at 07:08
  • http://pastebin.com/Q8n0d3eD | Just a try though. – Apache May 23 '10 at 07: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? –  May 23 '10 at 08: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. – Apache May 23 '10 at 08: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. –  May 23 '10 at 10:07
  • Yeah if you got the SSH issue thats a resolv or hosts. At least I fixed it with adding the proper hosts file. Versions dont matter if it works locally thats why I said THIS or THAT. – Apache May 23 '10 at 10:18
  • I've sorted out the SSH issue, I reverted my `hosts` file back to original state. I tried changing the nameserver in `resolv.conf` to something other than my router, however that doesn't seem to affect anything. Any more ideas? –  May 25 '10 at 13:39
  • Okay I'm out of ideas. What about installing a Debian/openSUSE/Fedora / whatever works? :) – Apache May 25 '10 at 13:52
  • I'm comfortable with Ubuntu, and true to it's claim, it does just work (at least I thought). I've cross posted on ubuntuforums.org in the hope someone else may have come across the same problem already (http://ubuntuforums.org/showthread.php?t=1492930). Thanks again for your help and your patience, much appreciated. –  May 25 '10 at 14:16
  • You could also try #ubuntu channel on Freenode IRC. – Apache May 25 '10 at 14:45
0

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.)

harrymc
  • 483
  • 3
  • 11
  • 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. –  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. –  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: http://redmine.lighttpd.net/projects/spawn-fcgi. – harrymc Sep 22 '10 at 15:31
0

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 09: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. –  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. –  Sep 22 '10 at 14:23
  • Installed lighttpd-1.4.28 from source, got running, however the same problem is evident. –  Sep 22 '10 at 14:56
0

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.

Bond
  • 741
  • 4
  • 11
  • 22