Performance question Redux {Scanned by HJMS}

Furnish, Trever G TGFurnish at HERFF-JONES.COM
Fri Oct 10 00:46:15 IST 2003

25?!  That's a lot of blocked processes, unless we're talking about a
*really* busy system.  You were running "vmstat 2", right?  If not, what was
the interval on the vmstat?

Is anything else going on on that system besides email handling?  Um, for
example a system backup at the time that you were doing your vmstat? :-)

Can you identify the blocked processes?  Assuming you're running on
something that has a recent version of ps, you might be able to get useful
info by repeatedly running the following command in one window as quickly as
possible while running vmstat in another window:

ps -eo state,pid,user,cmd,args | perl -ne 'print if (/^\S*D\S*\s/)'

By "as quickly as possible" I'm suggesting that you copy the entire line,
including a carriage return at the end, and then just repeatedly paste it
into your terminal window.  Or you could script it, like so.  Keep in mind
though that this might actually contribute to a cpu shortage, if that's your
problem.  If so, you can stick in a 'sleep 1'

i=0; while [ $i -lt 1000 ]; do
   ps -eo state,pid,user,cmd,args \
   | perl -ne 'print if (/^\S*D\S*\s/)'
   # Uncomment next line to go more slowly.
   # sleep 1

Sorry, but I deleted earlier messages in this thread and don't remember your
platform/hardware, so I'm not sure if that's appropriate for your platform.
And there's almost certainly an easier way too, but my brain's befuddled at
the moment from a long day.

The ps command just outputs lines with the process state as the first
column, so that we can more easily match just the processes that are in
uninterruptible sleep (the ones that show up in the b column of vmstat).
The goal is to figure out exactly which processes are blocked.  Those
processes should have a D in this field.  They might also have other
characters in that field though, so to get all of them the perl statement
matches anything with a D in the first field, regardless of where it's at
within the field.

Put that into a file, chmod a+x the file, and then run it while you run your
vmstat.  Again, the goal is just to help identify the blocked processes.  If
the processes in question are long-lived, then you're going to get a *lot*
of output.  If they're shortlived, then you may not catch them at all with
the sleep uncommented.

Hope it helps.


> -----Original Message-----
> From: Alan Fiebig [mailto:mailscanner at ELKNET.NET]
> Sent: Thursday, October 09, 2003 3:07 PM
> Subject: Performance question Redux {Scanned by HJMS}
> Okay gang, I'm back!
> I've added an Ultra160 SCSI 10,000 RPM drive to my server today.
> I moved the spool directories to this new drive so that the,
> mqueue, and MailScanner directories will run on this new drive.
> (note, I already had MailScanner/incoming running on tmpfs)
> I made this new partition on the scsi drive a reiserfs filesystem
> per the recommendation I got yesterday.
> syslog remains on the original ATA drive, as does the swap and
> all the original directories. The ONLY thing I moved to the new scsi
> drive are the MS related spool directories.
> vmstat 'b' is still showing me with values as high as '25'.
> Any suggestions on what to try next?
> Thanks,
> -Alan

More information about the MailScanner mailing list