1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Website hangs when sending some form or anything

Discussion in 'Apache' started by postcd, May 1, 2014.

  1. #1
    Hello,

    i moved my sites to new linux server of mine (apache, mysql, php).

    From that time i experienced some bigger websites hanging for like 2-3 seconds before they start loadin. I mean when im browsing thru my website i click link, submit something and it waits saing in status field like "Waiting for mywebsite.com"

    So i want to ask what apache, php etc values, what to check ons erver?

    NOTE: my server is NOT overloaded (im checking "top -c" stats) so dont suggest me to upgrade etc.

    I have impression that it is waited untill website elements are loaded and then webpage load very quickly afte mentioned 2-3 seconds delay..

    thx
     
    Last edited: May 1, 2014
    postcd, May 1, 2014 IP
  2. Tier_net

    Tier_net Active Member

    Messages:
    35
    Likes Received:
    5
    Best Answers:
    3
    Trophy Points:
    58
    #2
    While your load may be OK, it could be that MySQL queries are taxing it briefly and causing a delay. Are the hardware specs of the new server better than those of the old server?

    Another thing I see often when this happens is an improper resolver configuration (/etc/resolv.conf).

    Try having ONLY this in your /etc/resolv.conf:

    nameserver 4.2.2.2
    nameserver 8.8.4.4

    Remove any "search" lines. The default install of many OSs adds an improper "search" line to resolv.conf

    If this is the problem, it is happening because your site(s) are loading elements from 3rd party locations.

    Another idea to try is running strace. You will have to be quick but locate the apache process that is hanging and run:

    strace -p PID

    where PID is the process ID. It will usually give you some clue as to what is stalling. You can also try running the PHP script directly if it is a PHP script and viewing the system calls:

    strace /home/path/to/your/php/file.php

    If it is stalling because of the resolv.conf problem, you will see a lot of POLL_IN or POLL_OUT system calls.
     
    Tier_net, May 21, 2014 IP