Each
Virtual Server is allocated its fair share of the resources
of the physical server. This manner of resource allocation
keeps one Virtual Server from abusing the performance
of the physical host server or of another Virtual Server
on the same physical server. In order to have consistent
excellent performance on your 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
Each Virtual Server needs
limits to keep one Virtual Server from abusing the performance
of the physical host server.
Checking the 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 Virtual Server:
- Load average
- Number of processes
- CPU use
- Memory use
Sample "Top"
Command
The following is a sample
of the output from running 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% InusePID
USERNAME PRI NICE SIZE RES STATE TIME WCPU
CPU COMMAND
89218 trout 28 0 1396K 1000K RUN 0:01 0.89%
0.73% top
13863 trout 18 0 2156K 392K pause 0:01 0.00%
0.00% httpd
95617 trout 2 0 2212K 932K accept 0:00 0.00%
0.00% httpd
92567 trout 2 0 2212K 936K accept 0:00 0.00%
0.00% httpd
14464 trout 2 0 2212K 936K accept 0:00 0.00%
0.00% httpd
89179 trout 18 0 1312K 824K pause 0:00 0.00%
0.00% tcsh
Defining top Terminology
|
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. E.g. waiting for something (sleeping),
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"
Killing a Process
- 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.
Note: Take care
when killing a process. The only time that you should
kill a process is if a process is hung and using up
your resources.
Memory and Processes
A process is a program
that is running, sleeping, or waiting. For example,
when your web receives a hit, HTTPD uses a process.
If the programs you have running exceed your memory
allocation, you will effectively shut down your own
Virtual Server. For example, if you have a Virtual Server
FreeBSD Standard with a RealAudio server running, you
would only have half the allocated memory available
for other processes, because the RealAudio server uses
four megabytes of the available memory.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:
% ps -ax | grep pop
% kill pid_number
|