Results 1 to 4 of 4
  1. #1

    Something eat whole memory (including swap) and server goes down...

    Hello,

    I have more users per one server (virtual hosting) and I have big problems on one server - someone's site/script is eating whole server memory including swap within one minute and then is the server freezed.

    I have no clue how to find the user/domain who doing it -- if his script start eat the memory, there is just one big httpd process in top - but it's apache main process (pid)...

    After apache restarting is the memory and swap OK, but I can't guard it every minute or restart Apache every minute...

    Can you help me to find out who can do that?

    There is about 200 domains on the server.

    Thank you very much!
    Milo

  2. #2
    Join Date
    Jun 2003
    Location
    World Wide Web
    Posts
    581
    Note down the process id, try `netstat -np $pid` and block the remote ip, or use `lsof -p $pid | grep home` and find the account. I hope you get enough time to do these before it freezes
    SupportExpertz.com - the name says it all!
    Managed Cloud Servers
    Server Management and Monitoring
    24x7 outsourced customer support

  3. #3
    Thank you....

    Though the top PID (taking about 99% of cpu in that moment) is the main Apache PID/process (not the user's process), so the commands you writted shows about 500 lines or more...

    Thank,
    Milo

  4. #4
    Join Date
    Jun 2003
    Location
    World Wide Web
    Posts
    581
    Yes, it could be the apache process which is running, but each content request is handled by a new apache child, so if you could use

    lsof -p $pid | grep home | grep -v $1 | grep -v $2 .....

    where $1, $2 etc are those matching strings in each line you want to eliminate from the output. Doing this will get you an output similar to

    /home/user/public_html/image.jpg or something. This way you get to know which request is making apache to take up all those resources. After getting an idea about the account, try :

    tail -f /usr/local/apache/logs/access_logs_for_that_account

    which will dynamically give you an update about the requests on that site.
    SupportExpertz.com - the name says it all!
    Managed Cloud Servers
    Server Management and Monitoring
    24x7 outsourced customer support

Posting Permissions

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