Brent Verner <brent@rcfile.org> writes:
> I suspect using usleep() instead of select() might
> relieve the serialization.
A number of people have suggested that reducing the sleep interval would
improve matters. I tried that just now, again on RedHat's 4-way box,
and was mildly astonished to find that it makes things worse. The graph
below shows pgbench results for both the current code (10 millisec delay
using select()) and a 10-microsec delay using usleep(), with several
different SPINS_PER_DELAY values. Test conditions are otherwise the
same as in my last message (in particular, LWLock patch version 2).
At any given SPINS_PER_DELAY, the 10msec sleep beats the 10usec sleep
handily. I wonder if this indicates a problem with Linux'
implementation of usleep?
regards, tom lane