Web services (HTTP, MySQL frozen)

  • Hi,


    I have an Ubuntu 12.04.05 LTS server, core I5, 8GB RAM.
    I use I-MSCP 1.2.2, Build: 20150212 with cca. 50 domains.


    Relatively frequent the users call me that the server is not reachable.
    They have right, I try to visit the pages and no HTTP answer from the server.


    Fortunately the server technically up and run, I can log in via SSH.
    But the apache2 service restart and the mysqld service restart doesn't help, only the full system restart.


    The question is: where can I start debug the problem?
    /var/log/apache2/error.log?
    /var/log/mysql/error.log?


    I don't see any error messages..

  • I would look at the resources of your system, maybe they're clogged.


    Check out the free and cached memory with free -m
    Then check the active processes: htop (if you do not have htop installed, try top)


    In htop, check what the average system load is.
    How many (virtual) cores does your machine have?
    Any process using 100% or the CPU's, or maybe, is there some software swapping?


    Also check /var/log/syslog, /var/log/messages

  • Sorry for my late post, but today was the next event, when the services crashed.


    I restarted the mysql service -> the server still down from browser.
    I restarted the apache2 service -> the server is UP from browser.


    So, something wrong with apache I think.


    I checked the mem as you said "free-m":


    Code
    1. root@mydomain:/var/log# free -m total used free shared buffers cachedMem: 3610 3366 244 0 736 1120-/+ buffers/cache: 1509 2101Swap: 9539 10 9529


    Top results:


    Code
    1. top - 10:10:41 up 23:14, 1 user, load average: 0.04, 0.07, 0.10
    2. Tasks: 228 total, 1 running, 227 sleeping, 0 stopped, 0 zombie
    3. Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
    4. Mem: 3696984k total, 3446740k used, 250244k free, 753944k buffers
    5. Swap: 9768956k total, 10692k used, 9758264k free, 1147396k cached


    My server processor is: Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz


    var/log/syslog is full of mailing (dovecot, postfix) messages, NOTHING about apache crashes.


    (I know the service stopping time, so I see +/- 30 min, nothing.)


    I have Ubuntu 12.04, so I don't have var/log/messages so I cechked /var/log/syslog
    Syslog is also full of mailing (dovecot, postfix) messages, nothing about apache.


    Anyway: how can I set up that mailing log messages go to separately?

  • Hi,


    have a look in /var/log/apache2/error.log
    Are there any errors?


    Greets
    Chris


    This is the full error log of yesterday:


  • Yesterday 9:58am was the restart of services by me.


    Otherwise yesterday I put +4GB RAM into the server.


    Here is the current free -m:


    Code
    1. total used free shared buffers cached
    2. Mem: 7642 7480 161 0 895 4797
    3. -/+ buffers/cache: 1787 5854
    4. Swap: 9539 0 9539


    (Why is used 7480k from 7642k ? Is this normal?)

  • Hi,


    this two entries are the problem, why your webserver is "frozen":

    Code
    1. [Wed Mar 11 09:40:38 2015] [error] server is within MinSpareThreads of MaxClients, consider raising the MaxClients setting
    2. [Wed Mar 11 09:42:59 2015] [error] server reached MaxClients setting, consider raising the MaxClients setting


    You can google for detailed information or raise the MaxClients in the apache2.conf


    Greets
    Chris

  • I know what MaxClients means, but I tought if the server reaches this limit, the next connections will be denied, but after some session will be ended, the server will be ready again.
    Am I right?
    Or if the server reaches the MaxClients, then will be frozen immediately?

  • Well,


    when there are no free processes then the apache will not serve any sites to new conenctions.
    I think you use MPM Worker. There ist the problem that one process has many threads. One thread serve one connection. Is one thread of one process hanging or out of control the entire process will not serve anything.


    Look at your logfile, there are some child processes that are not normal. So they can't serve anything and blocks new connections respectively hold the count of Clients/Connections.
    You have the possibility to use mod_status to look at current status when the Apache is "frozen".


    Here is also an interesting site with detailed information about MaxClients / ServerLimit etc.
    http://www.genericarticles.com…ase_max_clients_in_apache


    Greets
    Chris