2

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 :)

Steven
  • 275
  • 2
  • 9
  • 21
  • Are you able to get any kind of shell access to the server (SSH)? I'm not familiar with Plesk, does it have any interface to run commands on the server? If you can, try running `top`. – pferate Aug 04 '11 at 21:55
  • I've tried Telnet, but get no access. Plesk has SSH Terminal, but I'm not able to log in using my username / password :( – Steven Aug 04 '11 at 22:01
  • Just for future reference... for terminal login you should only be using `ssh`. `telnet`, `rlogin`, and `rsh` are hilariously insecure and outdated, and should be uninstalled and utterly purged from the system if they are present. – Parthian Shot Aug 03 '15 at 21:08

5 Answers5

2

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!

Sean Kimball
  • 869
  • 1
  • 8
  • 24
  • Thanks for good feedback. Is my `preforc.c` bad or okey? (see Q update) – Steven Aug 05 '11 at 21:21
  • your prefork looks fine... a default installation of plesk will have qmail & named running - unless you have shut them down, they should be inthe process list. all kinds of weird things could happen in named is not running..... – Sean Kimball Aug 06 '11 at 01:43
  • Check to see if named is running - try to run some queries against it to make sure it is behaving [see if it can resolve your local sites] – Sean Kimball Aug 06 '11 at 01:44
  • No one seems to have mentioned 'checking the log files' - sanity check! what do your slow sites apache logs show, what does the default /var/log/apache/ logs show? – Sean Kimball Aug 06 '11 at 01:45
  • Is your plesk cp slow as well? it is basically just another apache instance. - lets see a sample output from a ps -ax ? ... also - these are public sites? how about a url or two for us to see what you mean by slow. [are they all slow or just selected ones?] – Sean Kimball Aug 06 '11 at 01:46
  • You can see some output of my logfiles here: http://serverfault.com/questions/297723/i-think-my-server-is-being-hacked-what-should-i-do It does not seem that I was under attack. The server sems to be fine now, but it would be really nice to find out what went so slow. The log files don't really tell me much :( – Steven Aug 07 '11 at 15:20
  • What is `cp`? At the time, plesk was slow too and sometimes the page did not load - same as front end sites. I will call my ISP on Monday and as them if tehre were any problems with the servers. – Steven Aug 07 '11 at 15:22
2

You can see your load average running uptime.

Since your server is a VPS, the CPU power might not be fully yours and other users’ actions (that use the same hardware as your VPS) may have influence on your server. I experienced that on my own.

Another check worth might be iotop.

exic
  • 629
  • 6
  • 8
1

if you can't remote into it, can you get in via console? top would help, will give sorted processes by cpu, pressing M when inside top would sort by highest memory usage.

Output looks like enter image description here

R D
  • 203
  • 1
  • 2
  • 7
0

I don't know if Plesk has a utility for monitoring. You can install a monitoring software with web interface.

http://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems

Rufo El Magufo
  • 321
  • 2
  • 12
0

Does Plesk give you any kind of performance/status information?

If you can upload files to your web server still, you can try uploading a file that will execute shell commands and display the output.

For example, you can try this:

<?php

exec('TERM=xterm /usr/bin/top n 1 b i', $top, $error );
echo nl2br(implode("\n",$top));
if ($error){
    exec('TERM=xterm /usr/bin/top n 1 b 2>&1', $error );
    echo "Error: ";
    exit($error[0]);
}

?>

Since this is run in as you webserver's user, you won't see a full process list, but you can see some system information (CPU, Mem, and Swap usage, load, etc...). That might give you some more information into the problem.

pferate
  • 463
  • 2
  • 9