[PATCH] Add cpu_affinity_map configuration option to bind workers to cores

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sat, 11 Sep 2010 00:10:46 -0600

Add cpu_affinity_map configuration option to bind workers to CPU cores.

Allows the admin to place all workers on individual cores without
writing a lot of if-statements. For example,

     cpu_affinity_map process_numbers=1,2,3,4 cores=1,3,5,7

will have an effect for kids 1 through 4 only and will place them on
even cores starting with core #1.

If there are conflicts for a given process, the latest option wins and
a warning is printed. If the number of specified processes do not match
the number of specified cores, Squid quits with an error. Multiple
cpu_affinity_map options are merged.

Squid builds on systems without Linux CPU affinity calls, but setting
affinity only works if there are sched_getaffinity(2) and
sched_setaffinity(2) available. If there is no OS support but
cpu_affinity options are configured, Squid quits with an error. If there
is OS support but calls fail, Squid prints an error but does not quit.

Received on Sat Sep 11 2010 - 06:11:13 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 14 2010 - 12:00:05 MDT