4285ch02.fm Draft Document for Review May 4, 2007 11:35 am
46 Linux Performance and Tuning Guidelines
WCHAN Name of the kernel function in which the process is sleeping, a “-” if the process is
running, or a “*” if the process is multi-threaded and ps is not displaying threads.
RSS Resident set size, the non-swapped physical memory that a task has used (in
kiloBytes).
PSR Processor that process is currently assigned to.
STIME Time the command started.
TTY Ter m i na l
TIME Total CPU time used by the process (since it was started).
CMD Command line used to start the task (including parameters).

Thread information

You can see the thread information using ps -L option.
Example 2-6 thread information with ps -L
[root@edam ~]# ps -eLF| grep -E "LWP|/usr/sbin/httpd"
UID PID PPID LWP C NLWP SZ RSS PSR STIME TTY TIME CMD
root 4504 1 4504 0 1 4313 8600 2 08:33 ? 00:00:00 /usr/sbin/httpd
apache 4507 4504 4507 0 1 4313 4236 1 08:33 ? 00:00:00 /usr/sbin/httpd
apache 4508 4504 4508 0 1 4313 4228 1 08:33 ? 00:00:00 /usr/sbin/httpd
apache 4509 4504 4509 0 1 4313 4228 0 08:33 ? 00:00:00 /usr/sbin/httpd
apache 4510 4504 4510 0 1 4313 4228 3 08:33 ? 00:00:00 /usr/sbin/httpd
[root@edam ~]# ps -eLF| grep -E "LWP|/usr/sbin/httpd"
UID PID PPID LWP C NLWP SZ RSS PSR STIME TTY TIME CMD
root 4632 1 4632 0 1 3640 7772 2 08:44 ? 00:00:00 /usr/sbin/httpd.worker
apache 4635 4632 4635 0 27 72795 5352 3 08:44 ? 00:00:00 /usr/sbin/httpd.worker
apache 4635 4632 4638 0 27 72795 5352 1 08:44 ? 00:00:00 /usr/sbin/httpd.worker
apache 4635 4632 4639 0 27 72795 5352 3 08:44 ? 00:00:00 /usr/sbin/httpd.worker
apache 4635 4632 4640 0 27 72795 5352 3 08:44 ? 00:00:00 /usr/sbin/httpd.worker
2.3.5 free
The command /bin/free displays information about the total amounts of free and used
memory (including swap) on the system. It also includes information about the buffers and
cache used by the kernel.
Example 2-7 Example output from the free command
total used free shared buffers cached
Mem: 1291980 998940 293040 0 89356 772016
-/+ buffers/cache: 137568 1154412
Swap: 2040244 0 2040244
When using free, remember the Linux memory architecture and the way the virtual memory
manager works. The amount of free memory in itself is of limited use, and the pure utilization
statistics of swap are no indication for a memory bottleneck.
Figure 2-1 on page 47 depicts basic idea of what free command output shows.