Bug 60006 - Replacing g_mutex_skiplist_mtx mutex lock with pthread_spin_lock provides performance benefit
Summary: Replacing g_mutex_skiplist_mtx mutex lock with pthread_spin_lock provides per...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mpm_event (show other bugs)
Version: 2.4.20
Hardware: All Linux
: P4 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2016-08-15 16:47 UTC by Mejbah
Modified: 2016-11-21 20:31 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Mejbah 2016-08-15 16:47:44 UTC
While running benchmark ab with our tool we found that g_timer_skiplist_mtx is acquired very frequently but the contention is very low. We experinted by replacing this pthread_mutex_lock with spinlock. We achieve 7% speedup running 
./ab -k -c 350 -n 20000 localhost:8080/
in our 16 core linux machine.
Comment 1 Yann Ylavic 2016-08-22 08:53:55 UTC
There is a patch proposed in https://bz.apache.org/bugzilla/show_bug.cgi?id=57399#c5 which avoids this lock in the listener (unless necessary, i.e. it should be more contented in this case).

Could you please pass your test(s) with it?