A customer got a severe performance regression while running newaliases on a very big aliases file. The problem was eventually tracked down to calls to select(0, NULL, NULL, NULL, { 1, 0 }) from within the memory pool allocator (through __os_sleep(1, 0)), that intends to give other threads some time to free up memory. The code in 4.2 was slightly reworked so as to avoid calling __os_sleep() as often as it did in 4.1, so I've backported a patch and verified that it removes all of the extraneous select calls. The ABI apparently doesn't change, in spite of adding a field to a struct; AFAICT, it's an internal struct, whose size doesn't matter to external users. Double-checking is advised. I've grepped for all uses of the new field in 4.2, and found only one hit outside mp_alloc.c.
Created attachment 105466 [details] Back-port of the sleep-avoidance patch from 4.2.
Yup. There was a simple perl reproducer with 5000 records that ran an order of magnitude more slowly with db-4.1.25 than with db-4.0.14 or db-4.2.52. The bug is probably reassigned to perl.
*** Bug 138818 has been marked as a duplicate of this bug. ***
Sure, I'll check it.
I've already verified, there is a slow down. The test case is in bugzilla, assigned against perl. A straightforward 5000 entry perl database is an order of magnitude slower with db-4.1.25 than with either db-4.0.14 or db-4.2.52. I'm gonna grab this bug, since I'm rebuilding Berkeley DB and resolving db4 bugs this weekend.
There is also patch.4.1.25.2 from sleepycat that appears to address exactly the same issues that aoliva's patch does. In fact the patches are nearly identical, one unified, the other not.
Should be fixed by adding patch.4.1.25.2 from sleepycat. db4-4.1.25-9 headed for CVS and next RHEL3 update tomorrow, currently staged at ftp://jbj.org/pub/fc4.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-279.html