Results 1 to 17 of 17
  1. #1

    Why my server goes down ? please help

    I have machine with 500/GB and 2/GB ram core to duo processor CENTOS 6 INSTALLED. i am running simple website for PDF book download. currently i have disabled the downloading because when i enable the downloading my server goes down and website stops opening, it takes too much time to open web page. after restarting apache it's again start working fine but after few minutes again this same problem occurs.i checked the Load Averages from WHM, it reaches to 80% while enabled downloading there comes apache thread download.php url list which may being access by users in WHM Process Manager, like:

    ?download.php?fileid=3203
    ?download.php?fileid=3201
    ?download.php?fileid=3205
    ?download.php?fileid=3206

    all separate and eating memory. I don't know, should this thread once for all users or it repeats for each user ?

    after disable of downloading access file server works fine but still there i get list of apache threats like:


    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL
    nobody 0 0.0 0.1 /usr/local/apache/bin/httpd -k start -DSSL

    here's my httpd.conf SETTING

    Timeout 300
    TraceEnable On
    ServerSignature Off
    ServerTokens Full
    FileETag All
    StartServers 5
    <IfModule prefork.c>
    MinSpareServers 5
    MaxSpareServers 10
    </IfModule>
    ServerLimit 256
    MaxClients 60
    MaxRequestsPerChild 10000
    KeepAlive Off
    KeepAliveTimeout 5
    MaxKeepAliveRequests 100

    RewriteEngine on
    RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
    RewriteLock /usr/local/apache/logs/rewrite_lock

    <IfModule !mod_ruid2.c>
    UserDir public_html
    </IfModule>
    <IfModule mod_ruid2.c>
    UserDir disabled
    </IfModule>

    if i increase the max clients there is chance to allow more user to escape to face this problem but max clients consumes more memory. at the last stage memory ll be finished and server ll go down.

    can some one please help me out some how in this case ?
    any help ll be appreciated.

  2. #2
    Join Date
    Jul 2011
    Location
    SriLanka
    Posts
    2,010
    Didnt you try install nginx or other than apache ? it will help you , but seems your server hardware not supporting you much on this.
    LankaPartnerHost.Com
    Canada Anti DDOS Webhosting, Reseller Hosting, WHMsonic, WHMsonic Resellers

  3. #3
    i didn't try for nginx, is nginx alternate of apache ? if yes which steps i need to follow for installation to replacement of apache ?

  4. #4
    Join Date
    Jul 2011
    Location
    SriLanka
    Posts
    2,010
    Its easy to install nginx on WHM, login to SSH and put following commands,

    cd /usr/local/src
    wget http://nginxcp.com/latest/nginxadmin.tar
    tar xf nginxadmin.tar
    cd publicnginx
    ./nginxinstaller install

    With this Nginx cpanel plugin both apache and nginx will work, but reduce load on apache and stops crashing apache.
    LankaPartnerHost.Com
    Canada Anti DDOS Webhosting, Reseller Hosting, WHMsonic, WHMsonic Resellers

  5. #5
    i just followed the steps and got this:

    Welcome to the Nginx Admin installer......Starting Install
    Please Wait .......
    Generating vhosts...
    Installing WHM interface...
    cp: cannot create regular file `/var/cpanel/apps/nginxcp.conf': No such file or directory
    Installing mod_rpaf...
    Updating cPanel Configuration
    Reading Apache Configuration
    updating Apache configuration
    ****************************************************
    * Installation Complete *
    *run /etc/init.d/httpd restart to start Nginx Admin*
    ****************************************************
    can you plase let me know how to use nginx rather then apache . should i just close apache service ? and what the above error directory not found ?

  6. #6
    Join Date
    Jul 2011
    Location
    SriLanka
    Posts
    2,010
    You can see Nginx admin under plugins in WHM, When click it you can see restart Nginx and other options, Check apache status on Home »Server Status » Apache Status, You can see very less requests processing by apache.
    LankaPartnerHost.Com
    Canada Anti DDOS Webhosting, Reseller Hosting, WHMsonic, WHMsonic Resellers

  7. #7
    Join Date
    Dec 2011
    Location
    Montreal
    Posts
    431
    Quote Originally Posted by LankapartnerHost View Post
    Didnt you try install nginx or other than apache ? it will help you , but seems your server hardware not supporting you much on this.
    You are not eliminate the cause maybe just the effect. Try to check going down with your "Timeout 300" to "Timeout 100" (or lower), stop Apache , wait a few seconds and than start again. Observe what is happening, check your logs and see if Apache server is going down, check if a script is terminated before executing etc.


    Regards
    George B. | ROWEBCA
    Web Hosting Services & Server Management
    Skype : rowebca

  8. #8

    Re: Why my server goes down ? please help

    I would likely reduce Maxrequestsperchild to something more like 1000. Here's a good page to help you with Apache optimization: http://cloudinservice.com/tune-apach...refork-module/

    Also since these are PHP processes it might be smart to take a look at the memory_limit in the PHP.INI file. This should be in /use/local/lib however could be over ridden by a local PHP.ini. The memory_limit is per process so this can team up with MaxClients to wreak havoc.

    I hope this helps.

  9. #9
    The another possibility is, your download page is being attacked. You need to check your web site's access logs and verify it they are legit or malicious traffic. If you are allowing to download files, it is recommended to protect it. You can force your users to login to area before they can download. If you have allowed downloading without login, your website can be attacked and it may overload your server.

  10. #10
    Join Date
    Mar 2005
    Location
    Ten1/0/2
    Posts
    2,529
    do you have mod_security installed with even some basic rules?
    CPanel Shared and Reseller Hosting, OpenVZ VPS Hosting. West Coast (LA) Servers and Nodes
    Running Linux since 1.0.8 Kernel!
    Providing Internet Services since 1995 and Hosting Since 2004

  11. #11
    @Kailash12, downloads is without logged in, which i am thinking can be the reason,
    @RRWH how i can check if mod_security is installed,

    i want to know from you guys there are many same threads in WHM Manager process. like:

    download.php
    download.php
    download.php
    download.php

    can some one clear me here, does this apache thread should be show once here in list or it appears for each visitor ?

  12. #12
    That means the file is being accessed via http hence you are seeing them in Apache processes.

  13. #13
    As you have got nginx installed now as reverse proxy of apache now, your static download files should be served via nginx now. This should reduce some load and issues.
    However, the issue seems to be also with the php handler.

    You can use FCGI as the php handler and limit the maximum number of FCGI threads to 5 or 6 and adjust it as much as your server can handle. This should resolve the server crash issue.

  14. #14
    Join Date
    Jul 2011
    Location
    SriLanka
    Posts
    2,010
    Now whats the issue after nginx install ?
    LankaPartnerHost.Com
    Canada Anti DDOS Webhosting, Reseller Hosting, WHMsonic, WHMsonic Resellers

  15. #15
    After installing the nginx issue is solved, but the threads are being show as it like before in list of Process manager. but when since i've installed nginx my server is running really fine and smooth. Load Average is about 0.30 against the usual traffic. i don't know what's the actually nginx did logically but my problem is almost solved. if you can mention me the exact problem i was having at the back-end before installation of nginx technically that ll really help me out in future. what was happening before and what's changed after installed nginx. I appreciate @LankapartnerHost solution. Thanks

  16. #16
    here's my Apache Status:

    Current Time: Thursday, 03-Oct-2013 11:32:14 EAT
    Restart Time: Tuesday, 01-Oct-2013 19:59:51 EAT
    Parent Server Generation: 3
    Server uptime: 1 day 15 hours 32 minutes 22 seconds
    Total accesses: 249091 - Total Traffic: 73.6 GB
    CPU Usage: u3.84 s8.97 cu55.89 cs0 - .0483% CPU load
    1.75 requests/sec - 0.5 MB/second - 310.0 kB/request
    12 requests currently being processed, 7 idle workers

    _W_..W_W_WWWWW__..W....W.W..._..W...............................
    ................................................................
    ................................................................
    ................................................................

    Scoreboard Key:
    "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
    "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
    "C" Closing connection, "L" Logging, "G" Gracefully finishing,
    "I" Idle cleanup of worker, "." Open slot with no current process

  17. #17
    Join Date
    Jul 2011
    Location
    SriLanka
    Posts
    2,010
    since your issue solved its better you closing the thread, I can see many replies there not helping to solve it.
    LankaPartnerHost.Com
    Canada Anti DDOS Webhosting, Reseller Hosting, WHMsonic, WHMsonic Resellers

Similar Threads

  1. Replies: 0
    Last Post: 07-08-2013, 11:20 PM
  2. Replies: 0
    Last Post: 07-02-2013, 11:14 PM
  3. VMStorm Cloud VPS /|\ Windows Server Host /|\ XP, Server 2003, Server 2008 (R2)
    By VMStormVPS Dave G in forum Cloud Hosting Offers
    Replies: 0
    Last Post: 05-17-2012, 05:07 PM
  4. 3+ Server Cluster, 1TB File Server, 10M (3,240G xfer) Included, $99/Server
    By alias_willsmith in forum Dedicated Hosting Offers
    Replies: 7
    Last Post: 08-28-2007, 05:40 PM
  5. Replies: 4
    Last Post: 09-25-2004, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •