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. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Don't fancy restarting my Apache; that is waaay above my comfort level.

    How do I find /var/log/httpd ?
     
    egdcltd, Aug 3, 2006 IP
  2. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #22
    go to directory /var/log/httpd ? "cd /var/log/httpd"

    you can see many logs in it. eg. "tail -n100 access_log" should show u last 100 lines of this log.

    If permission is denied.. you probably don't have access rights and need root access.
     
    DigitalPeon, Aug 3, 2006 IP
  3. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #23
    Do I do that in Putty? When I type /var/log/httpd I get the message

    -bash: /var/log/httpd: is a directory

    And I do have root access to the server to the best of my knowledge.

    Correction: when I do cd /var/log/httpd I get the error permission denied
     
    egdcltd, Aug 3, 2006 IP
  4. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #24
    yes its a directory. did you "cd /var/log/httpd"?
     
    DigitalPeon, Aug 3, 2006 IP
  5. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #25
    Yes, after I posted, then I got a permission denied error.
     
    egdcltd, Aug 3, 2006 IP
  6. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #26
    u need root access?
     
    DigitalPeon, Aug 3, 2006 IP
  7. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #27
    I did think I had it.
     
    egdcltd, Aug 3, 2006 IP
  8. bobisawsome7

    bobisawsome7 Notable Member

    Messages:
    1,466
    Likes Received:
    104
    Best Answers:
    0
    Trophy Points:
    200
    #28
    isn't a VPS a dedi divided into a few account? when it is, couldn't be some other customer's fault that the server is overloading?
     
    bobisawsome7, Aug 3, 2006 IP
  9. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #29
    Yes to the first, don't know to the second. I do know I have had quite a few problems with something overloading the server, but I don't know what.
     
    egdcltd, Aug 3, 2006 IP
  10. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #30
    yes. sonic is right.

    I don't know if you have root access. It can type "whoami" to see if you are really root.
     
    DigitalPeon, Aug 3, 2006 IP
  11. DigitalPeon

    DigitalPeon Active Member

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #31
    i am going to bed now. Get back to you later. Good luck with your troubleshooting ;)
     
    DigitalPeon, Aug 3, 2006 IP
  12. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #32
    Well, it doesn't say I'm root, but I was sure I was supposed to have root access, at least to my part of the server. I've emailed the support to see what they say.
     
    egdcltd, Aug 3, 2006 IP
  13. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #33
    Thanks, and I should too.
     
    egdcltd, Aug 3, 2006 IP
  14. egdcltd

    egdcltd Peon

    Messages:
    691
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #34
    I did have root access, I just wasn't logging on with it. Don't know what to now I'm on though.
     
    egdcltd, Aug 3, 2006 IP
  15. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #35
    As root, you should do a compilation of the things noted above:
    - ps aux shows you all processes in a snapshot
    - top shows you an ongoing picture of what's running, typically sorted by cpu cycles

    You want to run one then the other as beginning diagnostics to see if anything sticks out:
    - with 'ps aux' to see if you have a gazillion threads of something running. If you see maybe 30 or 40 httpd (apache/webserver) processes running that's likely fine. If you see 300, the question is, why does apache have 300 open connections. In other words, ps aux can be used to tell you if a lot of little processes are the problem. A DOS attack would show up as a lot of httpd processes - all consuming just a bit of resources but with the volume adding up to a problem.
    - the 'top' command will show you if one or two individual processes are hogging things. I would be very surprised if one httpd thread used much in the way of resources. If you see one process that's chewing up a bunch of the CPU for an extended period of time, that's your problem.

    One or the other of those commands should start to give you an idea of where the problem is. If it's apache/httpd, then the previous suggestion was to view your logs. That's done by going to the directory the logs are in - typically by typing in
    cd /var/log/httpd
    Then do a 'ls -al' to get a list of files. One of them should obviously be the log file. As noted above, it could be called 'access_log'. On my system, the file is called info. Assuming the file name is 'access_log' then you can type in this:
    tail -100 access_log
    which will output the last 100 lines of the access log file.

    Better yet, to see it 'live', use this command:
    tail -f access_log
    which will provide a continued output of the last line of the file - in other words everytime a line is written to the file you'll see it on the screen instantly. The -f option is a great way to monitor log files in realtime.

    Again, the tail command is along the lines of general diagnostics. You're just looking for something that sticks out.

    The other alternative is to see if you've got a cron job happening - something auto scheduled to run that is a resource pig. Log analysis will do this for example, which is why you run it at 4 or 5 in the morning when nothing else is happening. To see your scheduled tasks type in:
    cron -l
    (that's an 'ellll' - stands for list). Do that as root and as your regular user. It will list all programs and when they are run. The first few characters will be all funky numbers and stars - you'll need to google on what they mean - they indicate how frequently the task is run, like once aday at 12, or every 15 minutes, etc.


    None of that solves your problem, just gives you some places to start looking for symptoms.
     
    wheel, Aug 3, 2006 IP
  16. Important

    Important Peon

    Messages:
    87
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #36
    I think you should try to learn n understand server overloading. wheel gave some nice tips :)
     
    Important, Aug 14, 2006 IP