Too Much Context Switching?

alex at schnarff.com alex at schnarff.com
Mon Jun 30 02:45:35 UTC 2008


I'm the webmaster for www.marssociety.org, which is a FreeBSD 
6.2-RELEASE box running on a dual-core AMD Opteron setup with 4GB of 
RAM. The box is reasonably busy, as it's the sole piece of hardware 
running web, database, and mail operations for the Mars Society, an 
international nonprofit group dedicated to space exploration. We 
regularly send out newsletters to ~10,000 members, and our web site is 
averaging ~50,000-100,000 hits/day.

The main portion of the web site is run via the Zope/Plone CMS system 
(Plone 2.5, for anyone who may care). Recently, it's been slowing down 
dramatically, and our Plone guy (not me -- I inherited the system and 
can't stand it) can't figure out why. I've been diving into OS-related 
issues, and in so doing, I ran across what appears to be a very high 
number of context switches going on. Here's some sample output from 
"vmstat 2":

procs      memory      page                   disk   faults      cpu
  r b w     avm    fre  flt  re  pi  po  fr  sr ad4   in   sy  cs us sy id
  2 5 0 1311980 410176  702   1   0   0 587   9   0  544 3194 954 49  2 49
  2 5 0 1311980 410172    2   0   0   0   3   0   6  316 3599 3749 51  2 47
  2 5 0 1313804 409348  659   0   0   0 480   0  12  381 9903 8141 52  4 44
  2 5 0 1311188 409908    3   0   0   0  81   0   0  430 12153 9019 53  4 43
  2 5 0 1311188 409904  140   0   0   0 123   0  14  462 11912 8323 50  4 47
  2 5 0 1311700 410224   76   0   0   0 113   0   1  612 6791 5749 53  2 46
  1 5 0 1311532 409936  721   0   0   0 597   0   0  207  851 531 54  1 45
  2 5 0 1308908 410508    2   0   0   0  80   0   6  382 10527 8253 50  4 46
  1 5 0 1307084 411344   10   0   0   0 115   0   0  398 13087 8903 48  4 48
  2 5 0 1307112 411288    6   0   0   0   7   0   3  440 11023 8619 54  2 44
  2 5 0 1313604 404780  883   0   0   0  80   0  10  480 13711 10526 52  4 44
  1 5 0 1315320 404468   37   0   0   0   0   0   0  629 1651 2509 50  1 48
  2 5 0 1360792 367620 4926   0   0   0 315   0  14  346 7631 3078 60  2 38
  2 5 1 1371172 366348  268   0   0   0 103   0   0  527 9903 8926 51  3 46
  2 5 0 1361772 372800 1002   0   0   0 1807   0   0  571 11340 8572 54  6 40
  3 5 0 1356132 373348  135   0   0   0 198   0   0  884 11792 9699 50  4 46
  1 5 0 1344928 380692   78   0   0   0 986   0   0  552 15652 13671 50  5 45

Unfortunately, this is the only busy FreeBSD box I have access to, so I 
have no good way of telling if the values I'm seeing are abnormal or 
not. Can anyone tell me if these numbers look high, or if anything from 
the vmstat output above looks abnormal and should be followed up on?

Thanks,
Alex Kirk



More information about the freebsd-questions mailing list