Linux – How to see what processes makes the server slow

apache-2.2centos5linux

All my websites on my server are extremely slow or not loading at all. Even server admin (Plesk) will not load some times.

There's been no changes to the sites for the last coupple of months.

How can I see what processes is making my server slow?

My environment looks like this:

Server: VPS running Linux 2.8.x
OS: Centos 5
Manage interface: Plesk 9.x
Memmory: 1024MB
CPU: 2.2GHz

My websites run on PHP and MySQL.

I finally managed to telnet (Putty + SSH) in to my server.
Running top did not show any processes using more than max 2% CPU and none were using exesive memmory.

I also got a friend to install a program that checks the core files, and all seemed fine.

So I'm leaning towards network issues or some other server malfunction. But I'm not able to find out what can be wrong.

Here are some answers to Sean Kimball:

  • I don't run mail services on my server yet
  • There are noe specific bandwidth peaks.

Prefork looks like this

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>
  • Not sure what you mean with DNS question. But I think it's up and running.
  • There are no processes running wild
  • Where can I find avarage load?

    Telnet is disabled and I have to log in using SSH 🙂

Best Answer

Can you tell us a little more about your environment - ram, cpu, is this a virtual machine, plesk version.. etc. Also, is it just Apache that is slow, mail, ftp, dns etc all are fine?

  • Check your mail queue [qmqtool is excellent for this]
  • Check your bandwidth & throughput, was/is there a spike
  • If this is a virtual machine, you should be able to troubleshoot using the virtuozzo tools
  • Have you 'tweaked' your apache config? specifically this part:

    <IfModule prefork.c>

    StartServers 2
    MinSpareServers 2
    MaxSpareServers 5
    ServerLimit 200
    MaxClients 200
    MaxRequestsPerChild  4000
    

    </IfModule>

  • DNS, is it running? do your forwarders answer queries.

  • ps -ax, any odd processes you can't identify?
  • what does your average load look like at any given time?

Finally, unrelated to your issue, get SSH working & shut telnet down - for godssakes please!