New on LowEndTalk? Please Register and read our Community Rules.
All PHP files slow - no server load
I'm managing a server for someone and I'm absolutely baffled by this. Does anyone have any ideas?
I'm using Nginx + PHP5-FPM and all PHP files loaded over port 80 are extremely slow - they take several minutes to load, even a simple phpinfo file.
php -i over shell is lightning quick, and the server itself is pretty powerful and has a very low load.
I've also tried Apache and Litespeed with the same results as Nginx. Flat HTML fiLes are also very quick.
This has been happening since a power outage and a hard reboot.
Has anyone got any ideas why this server could be so slow at processing PHP files?
Comments
Check your syslog if any hints there
wget a php page within the server? e.g. wget http://mydomain/info.php
You could have file corruption from the outage/reboot, fsck the drive maybe.
jtodd - i bet you have a swtune file in /etc/ that's overriding your maxservers line
Francisco
Nothing that stands out
It's quick
This should have been done automatically following the reboot I think?
Thanks but there isn't one
cd /etc
find . | grep tune
I know there's 'better' ways to use find but i'm lazy :P
Francisco
[[email protected] init.d]# cd /etc
[[email protected] etc]#
[[email protected] etc]# find . | grep tune
[[email protected] etc]#
boourns!
I guess just check your maxservers line.
I do know debians default on OVZ templates is like 10 :P
Francisco
It's nginx!
It seems to load the phpinfo file pretty quick now actually, but it's still extremely slow at loading the forum (www.montrealracing.com). Here's an excerpt from a strace I put on one of the processes:
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9 fcntl(9, F_GETFL) = 0x2 (flags O_RDWR) fcntl(9, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(9, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("66.199.138.142")}, 16) = -1 EINPROGRESS (Operation now in progress) poll([{fd=9, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1, 60000 <unfinished ...>
So it's waiting for something from 66.199.138.142, which matches up with a lot of SYN_SENT requests shown in lsof -i :80.
Both I and the forum owner have no idea what it could be waiting for from that IP.
Is it a remote SQL?
Francisco
Nope, local SQL server.
Is the process in question involving fsockopen? You might want to check the resolv.conf and the responding nameservers.
post nginx config file?
Grep for that ip in forumsource ?
cat /etc/resolv.conf
It's quite possible it's one of your DC's resolvers and it's just hanging.
You could try replacing it with 4.2.2.1 or 8.8.8.8
EDIT - Granted it shouldn't be using TCP for the lookups, but given the hostname of the box, the IP originates from Montreal so it's likely within the DC....
Francisco
nginx.conf: http://pastebin.com/YYj2FzLY
[[email protected] conf]# cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4
The forum is massive with lots of plugins etc. and a lot of the files are encrypted, but that's about where my thoughts are - perhaps it's a vB mod calling home?
If there encrypted it must be a two way thing to run them. Without knowing where it is and what its doing its going to bw hard to disable. How about installing using existing database and adding plugits 1 by 1
If your vps outside US using 8.8.8.8 / 8.8.4.4 if in US 4.2.2.1 / 4.2.2.2
There are about a hundred and the database is massive
Aren't they both anycasted?
By the way, thanks for all of your help you guys!
Doing a reverse lookup these doesn't seem to be any domain pointing to that ip. So the name servers likely won't help
No this not correct. For EU use which start 8 and the US use 4
8.8.8.8 and 8.8.4.4 is Google DNS
4.2.2.2. and 4.2.2.1 are Level 3.
Yes i know this. but if you are using EU server you will go to 8.8 and US will used level3 4.2
Try using 4.2 in EU server will work correctly?
Yeh it works fine.
They are using Anycast, it doesn't matter where you are from.
humm, Maybe but i used it before never work fine looks problem from me
.