performance scalability of a multi-core

Tollef Fog Heen tfheen at redpill-linpro.com
Thu Oct 8 10:03:32 CEST 2009


]] Ken Brownfield 

| My weapon of choice there would be oprofile, run something like this  
| under high load and/or when you have a lot of threads active:

latencytop (on newer linux kernels) could also be useful.

| At the bottom you'll see the most costly calls and any obvious stand- 
| outs.  My runs on Varnish show an interestingly high amount of  
| timezone stuff in libc, but no real low-hanging fruit.

Interesting.  I am guessing this is strftime being silly.  Citing a
friend of mine, Steinar H. Gunderson, discovered this gem:

  It seems that by POSIX, strftime needs to call tzset, which
  initializes the timezone information in glibc. tzset needs to read the
  environment to see if the environment variable TZ has changed. The
  environment is essentially a global variable, so tzset needs to take a
  lock and then scan linearly through it (which can take some time if
  it's large). Furthermore, since TZ points to a file, tzset needs to
  stat it to check that it hasn't changed -- and it seems to do so under
  the lock, for good measure.

I think we might want to roll our own strftime in TIM_format rather than
relying on the madness that is described above and that is POSIX.

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73



More information about the varnish-misc mailing list