
On 12 August 2013 12:41, Trent W. Buck <trentbuck@gmail.com> wrote:
David <bouncingcats@gmail.com> writes:
I'm using iceweasel 17.0.7 in wheezy on the ancient systems I mentioned upthread, and I've never noticed my swap partition in use. I'm curious about the apparently different experience. Perhaps it is swapping and I've just never noticed? Would that info be logged anywhere?
free(1) reports the swap usage as at query time.
Thanks, I already know free(1). By the word "logged" I meant a history or cumulative report of swapfile use, not a snapshot. For example does the kernel write anything to some logfile when it actually swaps, or can it be instructed to do so, or is there some other tool for monitoring this apart from running 'watch free' and staring at it forever to see if the "Swap:" zeros ever briefly change to anything else. I looked at vmstat(8) whose man page says: "The first report produced gives averages since the last reboot. " and "so: Amount of memory swapped to disk (/s)" so if I understand that correctly even the "first report" of "so" would be an average "/s" per second since last reboot?. So is the answer to run vmstat continuously with a one second delay, so that these averages can be taken as actual measurements? I found this article http://www.linuxjournal.com/article/8178 where the comments mention vmstat log files, but following that link is about post-processing with other tools. Running vmstat in a loop post processing a logfile of its output seems an odd method to detect cumulative use. I suppose awk could do it, but isn't there any nicer way? I do often see load averages much greater than one on these older desktop/notebook machines. But I have never noticed swapfile use. So I'm wanting to answer the question "is my swap file ever used?" because I suspect it never is, and I wonder why my experience is so different to Craig's comment, or if I'm missing something. So I'm looking for cumulative data. Or another way to answer that question. I could look to see if the swapfile content changed, but that wouldn't give a quantitative indication of use.