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.

Server Overloading

Discussion in 'Site & Server Administration' started by egdcltd, Aug 3, 2006.

  1. #1
    My site is currently running on a VPS and I am experiencing problems with the server load; there are 4 cpus but use is spiking to 10 or higher. How do I find out what is causing this?
     
    egdcltd, Aug 3, 2006 IP
  2. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    you can look at the processes? are you running linux or windows?
     
    DigitalPeon, Aug 3, 2006 IP
  3. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's a Linux server. As to looking at the processes, I don't know. How would I go about doing that? I know next to nothing about running a server.
     
    egdcltd, Aug 3, 2006 IP
  4. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    ssh in and type
    "ps -ax" (without quotes)

    or you can just type "top" (without quotes)

    to see the processes in realtime. That should give you some clues.


     
    DigitalPeon, Aug 3, 2006 IP
  5. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just treat me as if I'm a complete idiot here. How do I ssh in?
     
    egdcltd, Aug 3, 2006 IP
  6. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    you must have a shell account. If you have access to a VPS most likely you are given an access. use a shh client such as putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

    type in your server's ip address or hostname in putty, open it and u should see a login prompt. Now login and check the processes. ;)
     
    DigitalPeon, Aug 3, 2006 IP
  7. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Oh, yes, I had putty before my computer wiped out. I'll reinstall it.
     
    egdcltd, Aug 3, 2006 IP
  8. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Okay, I've got a whole list of stuff now. The server is (currently) not overloading. What should I look for when it does?
     
    egdcltd, Aug 3, 2006 IP
  9. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #9
    runing your "top" and you should see realtime processes.

    Look at the cpu% and mem left. that should give you an idea of an overloading server. If it looks overload go to the list. The heavier processes are at top and may be unusually high. Now that should give you some idea what kinda task is eating up your resources. httpd, mysql, mail? etc..
     
    DigitalPeon, Aug 3, 2006 IP
  10. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #10
    A few times whilst I was watching httpd went to the top, by the looks of things, when the server started overloading according to cpanel status. What is httpd?
     
    egdcltd, Aug 3, 2006 IP
  11. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #11
    httpd is your web service. Apache http daemon...
    Check your web log. it may show something...
    I would run "ps -ax" to look at the unusual httpd
    then a "netstat -a" to look at the httpd again.
    You would get worried if there are hundreds to thousands of httpd going on and off at 1 time because that could signify a DDOS attack.


     
    DigitalPeon, Aug 3, 2006 IP
  12. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Is the TIME+ column the total time a process has been running? Because, if so, 2 of the httpd processes have been running for over 10 hours.
     
    egdcltd, Aug 3, 2006 IP
  13. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I ran ps -ax and got the following message:

    Warning: Bad syntax, pehaps a bogus '-'

    Followed by a whole bunch of stuff in columns: PID TTY STAT TIME COMMAND

    Running netstat -a brought up yet more stuff.
     
    egdcltd, Aug 3, 2006 IP
  14. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #14
    that's normal. some httpd processes will get stucked on bad script.
    just kill the proccess by typing "kill pid" where pid is the process id you see as numbers on the left column. "ps -ax" should give u a static list. Look for the one with an unsual long time then kill it! :D
     
    DigitalPeon, Aug 3, 2006 IP
  15. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #15
    ps will run without -

    "ps ax"
     
    DigitalPeon, Aug 3, 2006 IP
  16. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #16
    [​IMG]

    That's a screenshot of the two longest running processes. Is there any way of finding what they are?
     
    egdcltd, Aug 3, 2006 IP
  17. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Hi
    if you run awstats in a bussy server its not unusual that cpanel reports high server load.

    Keep checking top every now and than.
    If you see .pl processes hogging server its probably awstats.
    It is not serious as it runs on a low prio so httpd processes will always get priority ( thats web site requests)

    You can ask the server guys to adjust some settings for you do the effect is less.

    Had a similar issue on of my dedicated and the server guys sorted it.

    Hope it helps

    Expat
     
    expat, Aug 3, 2006 IP
  18. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #18
    This server doesn't actually have awstats in cpanel, although I do miss it.
     
    egdcltd, Aug 3, 2006 IP
  19. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #19
    So, to stop those two processes I kust type the following commands:

    kill 5605
    kill 5638

    Can anything bad happen to my server by doing this?
     
    egdcltd, Aug 3, 2006 IP
  20. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #20
    If you think there is bogus script doing that to your server. compare the httpd logs with your unusual processes. i believe your logs are in /var/log/httpd

    yes.. you can kill the suspects this way or

    "killall httpd" and restart your apache
     
    DigitalPeon, Aug 3, 2006 IP