Ways to monitor Disk IO and Traffic to pinpoint an error
Ok so I'm still a total Linux novice even though I've been running my linodes for a couple of years now. Lately (as in the last couple of days), I've been having the occasional massive CPU spikes, my disk IO rate has been far more active and there seems to be a lot of transfer spikes. Most of these happen when I'm not paying attention (not that I spend my watching TOP scroll by
What are some methods or tools that I can use to try and pinpoint what causes the increase load? I would love to also be able to see exactly which group of files are being transferred. It is possible that I suddenly got a bunch more traffic but the spikes are a bit worrying.
Also, I already checked the Apache logs to see if there was anything out of the ordinary and I made a couple of corrections to APC but that was about it. I don't know if there is a program I can run for a day and then check all through logs to see whats going on.
So I'm running:
Debian 6
Apache 2.2.16
PHP 5.3.3-7+squeeze15
Thanks for the help!
15 Replies
also, since i made my change to APC today, my IO load is way higher. At what point should I be concerned about it?
How are you running PHP? How big are these spikes? Can you give some numbers?
![](
You really need to check the access logs for the times during those spikes and see what was accessed.
As for the disk IO increase, well, since you say you tampered with APC I'd say that's the cause. I'd hazard a guess and say you reduced APC memory and it went from swapping to disk IO because the PHP files have to be purged and reloaded between requests. But that's really a lot of assumption.
You should post your APC config.
extension=apc.so
apc.enabled=1
apc.shm_segments=1
;32M per WordPress install
apc.shm_size=1024M
;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)
apc.numfileshint=7000
;Relative to the size of WordPress
apc.userentrieshint=4096
;The number of seconds a cache entry is allowed to idle in a slot before APC dumps the cache
apc.ttl=7200
apc.user_ttl=7200
apc.gc_ttl=3600
;Setting this to 0 will give you the best performance, as APC will
;not have to check the IO for changes. However, you must clear
;the APC cache to recompile already cached files. If you are still
;developing, updating your site daily in WP-ADMIN, and running W3TC
;set this to 1
apc.stat=1
;This MUST be 0, WP can have errors otherwise!
apc.includeonceoverride=0
;Only set to 1 while debugging
apc.enable_cli=0
;Allow 2 seconds after a file is created before it is cached to prevent users from seeing half-written/weird pages
apc.fileupdateprotection=2
;Leave at 2M or lower. WordPress does't have any file sizes close to 2M
apc.maxfilesize=2M
apc.cachebydefault=1
apc.userequesttime=1
apc.slam_defense=0
apc.mmapfilemask=/tmp/apc.XXXXXX
apc.stat_ctime=0
apc.canonicalize=1
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=0
apc.rfc1867prefix =upload
apc.rfc1867name=APCUPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
apc.lazy_classes=0
apc.lazy_functions=0
That spike at 20h is nothing I did. It's one of the things I'm concerned about and trying to track down.
~~![](<URL url=)http://pclennox.com/pic2.jpg
The thing is, I don't really know what it SHOULD look like. I'll take any and all advice at this point
Sorry…newbie moments…~~
@Azathoth:
I wonder what did you change in the APC config? And I suppose you checked the relevant error logs? Any of them filling up quickly? Other than that, you should check iotop and maybe even ftop for the most io active process.
All I did was change the from the default apc setup.
@danblack:
At least prune it by 300M
can you explain a little bit more what you are referring too?
@Tamerax:
@danblack:At least prune it by 300M
can you explain a little bit more what you are referring too?
The amount of unused apc memory allocation that I think I read wrong.