Performance improvements for gearmand_ready and gearman_server_function_get

Bug #1130521 reported by Keyur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
Fix Released
Medium
Brian Aker

Bug Description

This patch addresses 2 hotspots we've detected. We have ~2000 worker processes connecting a gearmand server and processing ~500 jobs/sec.

1) gearmand_ready: a very tight loop that burns CPU. The attached patch creates a new list (ready_con_list) on the connection_list object that is just for "ready" connections. I also changed the "con_list" to use the macros GEARMAN_LIST_ADD/DEL. Deprecated the use of GEARMAND_CON_READY as I didn't find any real use for it.

2) gearman_server_function_get: changed the function_list to a hash table. Increased the default hash table buckets to 991. In text.cc, the majority of 'changes' are just white-space.

Both of these combined dropped user CPU use by ~50%.

Revision history for this message
Keyur (keyurdg) wrote :
Revision history for this message
Brian Aker (brianaker) wrote :

Would you mind applying this to 1.0.3 instead of 1.0.2?

Thanks

Revision history for this message
Keyur (keyurdg) wrote :

Done. Attached.

Brian Aker (brianaker)
Changed in gearmand:
milestone: none → 1.0.4
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Medium
status: New → In Progress
Brian Aker (brianaker)
Changed in gearmand:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.