Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


All PHP files slow - no server load
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

All PHP files slow - no server load

jhjh Member
edited May 2012 in Help

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

  • seikanseikan Member

    Check your syslog if any hints there :)

  • jcalebjcaleb Member

    wget a php page within the server? e.g. wget http://mydomain/info.php

    Thanked by 1yomero
  • FRCoreyFRCorey Member

    You could have file corruption from the outage/reboot, fsck the drive maybe.

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    jtodd - i bet you have a swtune file in /etc/ that's overriding your maxservers line :)

    Francisco

  • jhjh Member

    @seikan said: Check your syslog if any hints there :)

    Nothing that stands out

    @jcaleb said: wget a php page within the server? e.g. wget http://mydomain/info.php

    It's quick

    @FRCorey said: You could have file corruption from the outage/reboot, fsck the drive maybe.

    This should have been done automatically following the reboot I think?

    @Francisco said: jtodd - i bet you have a swtune file in /etc/ that's overriding your maxservers line :)

    Thanks but there isn't one :(

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    @jtodd said: 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

  • jhjh Member

    [root@montrealracing init.d]# cd /etc
    [root@montrealracing etc]#
    [root@montrealracing etc]# find . | grep tune
    [root@montrealracing etc]#

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    boourns!

    I guess just check your maxservers line.

    I do know debians default on OVZ templates is like 10 :P

    Francisco

  • jhjh Member

    @Francisco said: I guess just check your maxservers line.

    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.

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    Is it a remote SQL?

    Francisco

  • jhjh Member

    @Francisco said: Is it a remote SQL?

    Nope, local SQL server.

  • nabonabo Member

    @jtodd said: 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.

    Is the process in question involving fsockopen? You might want to check the resolv.conf and the responding nameservers.

  • jcalebjcaleb Member

    post nginx config file?

  • exussumexussum Member

    Grep for that ip in forumsource ?

  • FranciscoFrancisco Top Host, Host Rep, Veteran
    edited May 2012

    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

  • jhjh Member

    nginx.conf: http://pastebin.com/YYj2FzLY

    [root@montrealracing conf]# cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4

    @exussum said: Grep for that ip in forumsource ?

    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?

  • exussumexussum Member

    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

  • letboxletbox Member, Patron Provider

    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

  • jhjh Member

    @exussum said: 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

    There are about a hundred and the database is massive :(

  • jhjh Member
    edited May 2012

    @key12 said: 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

    Aren't they both anycasted?

    By the way, thanks for all of your help you guys!

  • exussumexussum Member

    Doing a reverse lookup these doesn't seem to be any domain pointing to that ip. So the name servers likely won't help

  • letboxletbox Member, Patron Provider

    No this not correct. For EU use which start 8 and the US use 4

  • @key12 said: 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.

  • letboxletbox Member, Patron Provider
    edited May 2012

    @Daniel said: 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?

  • @key12 said: 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.

  • letboxletbox Member, Patron Provider

    @Daniel said: 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 :D.

Sign In or Register to comment.