1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Apache 2.0.46 deadlock problem?

Discussion in 'Plesk for Linux - 8.x and Older' started by linuxxphybrid, Nov 13, 2005.

  1. linuxxphybrid

    linuxxphybrid Guest

    Q1. The latest version of Plesk comes with Apache 2.0.46. Is this correct?

    Q2. If so, it is possible that the version of Apache that comes with Plesk has deadlock problems?

    Q3. Is it critical that I upgrade Apache?

    Q4. Is there any way to know what leads to deadlock? Can I configure Apache so that it logs deadlock error and its cause?
  2. hardweb

    hardweb Guest

    Are you talking about the Apacher used by your websites? What OS do you use on the server?
  3. linuxxphybrid

    linuxxphybrid Guest

    Yes, I am talking about Apache that displays all websites hosted. My OS is RHE.
  4. linuxxphybrid

    linuxxphybrid Guest

    Ok, here's update.

    I was away from my desk for an hour or so today, and this error occurred again then. My host company was monitoring this, and posted the following message:

    1. I kept saying that Apache locks up, but I think I need to correct this, because it appears that Apache is not completely locking up.

    2. If this is happening because of high load, how can I check to see if this is really happening because of high load?

    3. If this is happening because of high load, how can I resolve this?
  5. ShadowMan@

    ShadowMan@ Guest

    To see if it's high load, you can SSH into the server and use the following commands to help diagnose:

    ps -ax |grep httpd


    The ps command will show you how many httpd processes are running, if there are lots (or more than you anticipated), then you may be either under an attack, or may be hosting busier websites than you thought. If it's busy websites, then you would have to fine tune your Apache settings (or possibly upgrade your server, you didn't post any hardware specs).

    If it's some sort of attack, you can either wait it out, enlist the help of your datacenter, and certainly install things such as mod_security, BFD, mod_dosevasive, and other things.
  6. linuxxphybrid

    linuxxphybrid Guest

    Making a long story short, the problem happened again, and since I was monitoring this pretty closely, I asked my host company to look into this when this happened. They say that the problem was caused by high load, though they were unable to determine exactly what was causing the problem. They made the following changes to address the problem:

    1. Removed parameters specific to worker.c
    2. Raised MaxRequestPerChild to 4K
    3. Raised MaxClients to 256

    Q1. Does the solution sound reasonable?

    Q2. Why did they remove parameters specific to worker.c?

    Q3. Why did they raise MaxRequestPerChild to 4K?

    Q4. Why did they raise MaxClients to 256?
  7. ShadowMan@

    ShadowMan@ Guest

    This is apache 'tuning', as far as 'reasonable', that depends on if they are sure it's not an attack of some sort. If it's just due to high volume sites, and if the server specs are ok, then raising maxclients is fine.

    Setting MaxRequestsPerChild to 4K tells apache to kill the child process after it has served a max of 4K requests. The default is zero, which could cause a child process to live forever even after it's not needed, thus causing problems.

    More info on Apache tuning:

    There are other sites out there as well for Apache tuning, this is just one of them.
  8. hardweb

    hardweb Guest

    Lower the MaxRequestPerChild value to 500. This will improve the reliability.
  9. linuxxphybrid

    linuxxphybrid Guest

    What's wrong with 4000? Also can lowing MaxRequestPerChild to 500 cause some problem?

    I have a couple of other questions:

    <IfModule prefork.c>
    StartServers       8
    MinSpareServers    5
    MaxSpareServers   20
    MaxClients       256
    MaxRequestsPerChild  4000
    Q1. How come is MaxRequestsPerChild set inside <IfModule prefork.c> and not outside? (My apology if this is such a trivial question.)

    Q2. It is possible that Apache's not being able to connect to Tomcat is causing the problem, but I don't know how all relate each other. Why does Apache's not being able to connect to Tomcat create a problem for Apache? Also does it possibly cause high load?

    Q2.2. Isn't there something that I need to do inside <IfModule mod_webapp.c> in order to ease the problem?
  10. linuxxphybrid

    linuxxphybrid Guest

    Ok, I did this, but Apache still hangs. Httpd had 8 connections and was not responding. Once Apache restarted, it had 11 connectons and was responsive. Is there anything we can extract from this information?
  11. linuxxphybrid

    linuxxphybrid Guest

    The problem happened again, but I ran the following commands this time and took screenshots.

    top (Screenshots is here)
    ps -aux (Screenshots is here)
    ps -ef (Screenshots is here)
    ps -ax | grep httpd (while Apache was hanging) (Screenshots is here)
    ps -ax | grep httpd (after Apache restarted) (Screenshots is here)

    Is there any information that you can extract from this? If so, what can you figure from these? If not, how should I diagnose the problem next time? What extra information do I need to obtain in order to find the cause?
  12. amram

    amram Guest

    Same problem here
    Have you been able to solve it?

    I did a #tail -f /var/log/httpd/error_log
    while it was happening and
    dowloaded and watched it closely after the apache crashed. I didn't found anything that can directly describe the crash but there was lots of "file does not exit"s in the error log. also no high iowate or cpu usage just lots of httpd and apache not responding.
  13. linuxxphybrid

    linuxxphybrid Guest

    It would be great if you can review the following thread and tell us what you think about it:


    The problem itself hasn't been solved yet, but people who participated in the discussion found a work around, and my server currently has 99%+ uptime.
  14. amram

    amram Guest

    Thank You
    If I found any solution I will share it.