Each VPS v2 Virtual Server is allocated its fair share of the resources of
the physical server. This manner of resource allocation keeps one VPS v2 Virtual Server from
abusing the performance of the physical host server or of another VPS v2 Virtual Server on the
same physical server. In order to have consistent excellent performance on your
VPS v2 Virtual Server, it is very important to manage the load you put on it. The term
"load" refers to the usage of the following:
-
Memory
-
CPU
-
Files open
-
Processes
Checking the VPS v2 Virtual Server's Load
From the command prompt type:
% top
The top command
displays both cumulative totals of the host server and totals of your VPS v2 Virtual Server:
-
Load average
-
Number of processes
-
CPU use
-
Memory use
Sample "Top" Command
The following is a sample of the output of top:
last pid: 89301; load averages: 0.06, 0.02, 0.00 up
14+03:11:06 08:02:06
12 processes: 1 running, 11 sleeping
CPU states: 34.6% user, 0.0% nice, 15.2% system, 0.8%
interrupt, 49.4% idle
Mem: 325M Active, 52M Inact, 94M Wired, 12M Cache, 59M Buf,
7720K Free
Swap: 512M Total, 69M Used, 443M Free, 13% Inuse
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU
CPU COMMAND
89218 trout 28 0 1396K 1000K RUN 0:01 0.89%
0.73% top
3863 trout 18 0 2156K 392K pause 0:01 0.00%
0.00% httpsd
95617 trout 2 0 2212K 932K accept 0:00 0.00%
0.00% httpsd
92567 trout 2 0 2212K 936K accept 0:00 0.00%
0.00% httpsd
14464 trout 2 0 2212K 936K accept 0:00 0.00%
0.00% httpsd
89179 trout 18 0 1312K 824K pause 0:00 0.00%
0.00% tcsh
The following table describes the terms in the top file.
|
Term |
Definition |
|
PID |
Process ID number. Each program has a unique PID
associated with it. |
|
USERNAME |
The user that is running the process. |
|
PRI |
Priority. Some processes are more important than others or
need to wait for information from other processes. The priority is the
kernel's way of determining which process gets processor time first. |
|
NICE |
The "niceness" of a program. A number you can
set from 0 to 20. For example, a program with NICE
setting of 10 would allow many other programs to have CPU time before it. It
basically modifies how the kernel allocates priorities. |
|
SIZE |
Total size of a process, including memory and actual
program size. |
|
RES |
The actual amount of resources in use (typically memory).
Normally this is less than the SIZE. This can
reflect the current amount of memory actually in use. |
|
STATE |
What the process is doing: sleeping (waiting), running, or
polling (checking to see if an input condition has been met). |
|
TIME |
The amount of processing time the process has used. |
|
WCPU |
Of the processes waiting for the CPU, this process has
this percentage of them. (See the top man
page for more technical details.) |
|
CPU |
Percentage of all available CPU time that the process is
using. |
|
COMMAND |
The program running. |
While running top,
you can do a variety of other tasks, which are described below.
Increasing the Number of Processes Listed
While top is
running, press n, followed by the number
of process you want displayed.
Killing a Process
The only time you should kill a process is if a process is
hung and using up your resources.
-
While top is running press k.
-
Type the process ID (PID)
The left column stores the PID. You can kill multiple processes
by entering multiple PID numbers on one kill line, separated by spaces.
Memory and Processes
A process is a program that is running, sleeping, or
waiting. For example, when your Web receives a hit, HTTPSD uses a process. If
the programs that are running exceed your memory allocation, you will
effectively shut down your own VPS v2 Virtual Server.
Checking Processes
From the command prompt:
% ps
For example, if you want to check the processes that start
with POP, you would type:
% ps –ax | grep pop
The following is an example of killing a process:
% kill pid_number
|