On 9.12.2010, at 2.24, Timo Sirainen wrote:
Like the answer to question: Is the number of voluntary context switches by imap processes close to the number of called syscalls?
Oh, right, no. Syscalls don't increase context switch counts. So the voluntary context switch basically seems to mean that the process is doing a read(), poll() or something else (what?) that waits for input from elsewhere..
So with Ralf's previous statistics for one hour:
v2.0: 6887 imap logouts (processes) 26672928 voluntary context switches (3872 / process) 1313631 involuntary context switches (190 / process)
v1.2: 6832 imap logouts (processes) 1003200 voluntary context switches (146 / process) 155566 involuntary context switches (22 / process)
The v1.2 values look pretty good. v2.0's involuntary context switches isn't too bad either. So where do all the 3700 new voluntary context switches come from? The new method of initializing user logins can't add more than a few more of those. Running imaptest locally I get similar volcs values for v1.2 and v2.0. Wonder if you get different values?
If you don't mind some huge logs, you could also try the attached patch that logs the voluntary context switch count for every executed IMAP command. Maybe some command shows up that generates them much more than others.