Disk read and write measuring and monitoring

The tools i need are in
apt-get install sysstat

this will give me the command

iostat -x 5

Where the 5 means tell mne about disk usage for all partitions and disks every 5 seconds…

When you stop the command, running it again will display data since the last run, there is much more that has to do with IOSTAT that i will come to in a bit, this one here is simply the basic command and usage for my referance

IO stat will display something like the following lines for the second disk that has 4 partitions, the first line is the totals

sdb 0.20 0.20 33.20 16.00 728.00 1392.00 43.09 3.87 41.01 3.04 14.96
sdb1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb2 0.20 0.00 7.00 0.00 502.40 0.00 71.77 0.06 8.46 7.54 5.28
sdb3 0.00 0.20 25.60 15.40 204.80 1384.00 38.75 3.79 47.41 2.85 11.68

LINUX traffic monitor

There are many points and kinds of statistics one may want to monitor on a server (Or a desktop PC), the following are a sample of the things people commonly need

1- By Domain name, when you host people’s websites, you need to monitor there traffic, both Email and web, it may be worth mentioning that the only way this can be done is through log filres, he reason behind that is that HTTP and Email requests are pointed at IP addresses and Hostname (Domain name) is only available as data within the stream, something only parsed by the web server and the MTA (Mail transfer agent). Some software to analyze Log files exists and can give you the answers to Domain based network traffic.

2- By PORT, Ethernet card, and IP, For such uses i recomment IPTRAF for live monitoring, and ….

3- By Virtual machine in environments such as XEN, in that case you can use the ifconfig command to see every virtual adapter’s traffic usage.

I will come to this post with more soon.

NOTE, for windows network captures (packet sniffers), i have always used a windows utility called wireshark (previously etherial), Microsoft released a very similar utility called Microsoft Network Monitor 3.4 that is compatible with Windows XP and above, When i simply want a graph of usage, i have once used a utility that does the trick called bwmonitor that is for $25, but it does provide you with a 30 day testing period (There is certainly a different application that can do the job and most probably a free one too, i just used this because it was the first i found)

APC config files

Tis page is veing updated at APC Debian

Once you activate APC from PHP.INI, you should probably use some directives to make this magical invention work.

For example, APC and smarty templates don’t go together bery well, SMARTY caches it’s results into PHP files rather than reparsing them, if APC is set not to check for changes in files, it will simply not load the new SMARTY template untill the APC cached version is gone.

But APC is such a beuty, and it translates to lower load on your server.

First, you should understand that on a big PHP server, many changes need to be done.

First, APC data lives in shared memory, By default on a linux system this is usually 33 Megabytes, not enough for one big PHP program, you need to increase it

1- How much shared memory is there now

cat /proc/sys/kernel/shmmax

2- Change that to something suitable

vi /etc/sysctl.conf (Reboot don’t you think )

remember, Don’t go too high, if your system gets low on memory and starts swapping, you are out of luck

3- Make sure you know what the settings here do… what you can change for directories and what you can’t etc..

Directive Description Use Warnings More Notes
apc.cache_by_default
apc.coredump_unmap
apc.enable_cli
apc.enabled
apc.file_update_protection
apc.filters
apc.gc_ttl
apc.include_once_override
apc.max_file_size
apc.mmap_file_mask
apc.num_files_hint
apc.report_autofilter
apc.rfc1867
apc.rfc1867_freq
apc.rfc1867_name
apc.rfc1867_prefix
apc.shm_segments
apc.shm_size
apc.slam_defense
apc.stat
apc.stat_ctime
apc.ttl
apc.user_entries_hint
apc.user_ttl
apc.write_lock