Performance improvements for gearmand_ready and gearman_server_function_get

Bug #1130521 reported by Keyur on 2013-02-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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, the majority of 'changes' are just white-space.

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

Keyur (keyurdg) wrote :
Brian Aker (brianaker) wrote :

Would you mind applying this to 1.0.3 instead of 1.0.2?


Keyur (keyurdg) wrote :

Done. Attached.

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

Other bug subscribers