1. Apache module mod_status allows a server administrator to find out
how well their server is performing. A HTML page is presented that gives the current server statistics in an easily readable form. If required this page can be made to automatically refresh (given a compatible browser). Another page gives a
simple machine-readable list of the current server state.
To enable status reports only for browsers from the foo.com
domain add this code to your httpd.conf configuration file
<Location /server-status> SetHandler server-status Order Deny,Allow Deny
from all Allow from .foo.com </Location>
Also it is a better idea to enable extended status using the Directive
ExtendedStatus On
You can now access server statistics by using a Web browser
to access the page
http://your.server.name/server-status
You can get the status page to update itself automatically if
you have a browser that supports "refresh". Access the page
http://your.server.name/server-status?refresh=N to
refresh the page every N seconds.
Also a machine-readable version of the status file is available by
accessing the page
http://your.server.name/server-status?auto
Alternatively, if you have lynx installed, you can
also get a server statics report from the command line by running
the command apachectl status, or, for the extended
status report, apachectl fullstatus
2.TOP
The top program provides a dynamic real-time view of a running system.
It can display system summary information as well as a list of tasks
currently being managed by the Linux kernel.Top usually runs in an
interactive mode and we can input the options dynamically to view the
system status
<
You can also add more fields to the top display by pressing f
For example if you wish to add the swap usage of programs to the top
output.Press p after pressing f
By default the top output is sorted using the field %CPU .You can change
this using Shift+> or < respectively
top provides comprehensive information about the system performance and
can be an invaluable tool in diagnosing and troubleshooting system
problems. More options of this tool can be obtained from the man page or
by pressing h in the interactive mode
3. MTOP
Shows the mysql commands consuming the greatest time. By default, only
non-sleeping threads are shown, the --idle option shows idle threads
MTOP can be downloaded from http://mtop.sourceforge.net/
For installing mtop you need the curses library for perl,you can use your
operating systems package installer for this. In Debian GNU/Linux you can
use
apt-cache search curses|grep perl
Once the source file for mtop is untarred .It can be installed by running
perl Makefile.PL
make
make install
in the source directory
The most convenient way to setup your system to use mtop is to create a
database user called mysqltop which has no password. For security
purposes, this user should have all privileges set to N except
Process_priv which must be set to Y. To grant these privileges, execute
the following from the MySQL command prompt For mysql 4.0.2 and greater:
mysql> grant super, reload, process on *.* to mysqltop; mysql> grant
super, reload, process on *.* to mysqltop@localhost; mysql> flush
privileges;
For mysql 3.x and 4.0.1: mysql> grant reload, process on *.* to mysqltop;
mysql> grant reload, process on *.* to mysqltop@localhost; mysql> flush
privileges;
A similar tool for viewing MySql status is MYTOP
(http://jeremy.zawodny.com/mysql/mytop/)
4. IFTOP
iftop does for network usage what top(1) does for CPU usage. It listens to
network traffic on a named interface and displays a table of current
bandwidth usage by pairs of hosts
You can download IFTOP from:
http://www.ex-parrot.com/~pdw/iftop/
You will need libcurses and libcap for installing iftop. You can use your
operating systems package manager to install the requirements or you can
use the package manager itself to install iftop
>
iftop -i <interface> specifies the interface to monitor
Pressing p in the interactive mode will display connections to a
particular port
You can disable/enable host name lookups by pressing n
Help can be obtained using the following command line switch
iftop -h
Using the above mentioned tools one can obtain comprehensive information
about running processes ,apache server status and mysql queries that can
aid in troubleshooting a webhosting servers performance issues or identify
system bottlenecks. I wish you good luck in troubleshooting with these
tools.
About the author: Anoop.P.Alias has been working in LogicSupport for more
than 1.5 years . He is an GNU/Linux enthusiast and evangelist .He
scribbles at http://gnusys.net/