Mac OS X Server v10.6: Changing the number of Xgrid tasks per CPU core

It is possible to override the default virtual task processor mapping in Mac OS X Server v10.6 on an agent-by-agent basis. If the ProcessorCount integer value exists in the Xgrid agent preferences file, it overrides the default behavior. The Xgrid agent will allocate as many virtual task processors as are specified by the ProcessorCount value. There is no explicit limit to the value specified in this manner. For example, this value can be used to limit the number of tasks running at the same time to one on a computer that would normally allow more, or it can be used to allow more than one task to run at the same time on a computer that would not normally allow as many.

In Mac OS X Server v10.5, Xgrid had a one-to-one mapping of logical CPU cores to virtual task processors. On single-core single-processor computers, the Xgrid agent would run only one task at a time. On single-core dual-processor and dual-core single-processor computers, the Xgrid agent would run up to two tasks at the same time. On quad-core Xserve (Early 2009) and Mac Pro (Early 2009), which have 8 physical cores and 16 logical cores, the Xgrid agent would run up to 16 tasks at the same time.

In Mac OS X Server v10.6, the Xgrid agent maps every two physical cores to a single task processor. A single-core single-processor computer will still run 1 task at a time, as will a single-core dual-processor and a dual-core single-processor computer. An 8-core Xserve (Early 2009) or 8-core Mac Pro (Early 2009) will run four tasks at a time.

The tasks that the Xgrid agent runs still have access to all of the cores.  It is recommended that tasks submitted to Xgrid use technologies such as Grand Central Dispatch to take advantage of all available cores.

This article has been archived and is no longer updated by Apple.

Note: Before changing the default Mac OS X Server v10.6 task allocation behavior, profile your Xgrid utilization to determine the task limit that provides the best performance for your work loads and task assignments.

The following Terminal command will set the ProcessorCount agent preference value to the number of task processors that the Mac OS X Server v10.5 agent would have allocated:

defaults write /Library/Preferences/com.apple.xgrid.agent ProcessorCount `sysctl hw.ncpu | cut -f 2 -d " "`


This command must be run as a user with administrative privileges on each Xgrid agent host. The entire command must be entered as a single line.

Important: Information about products not manufactured by Apple is provided for information purposes only and does not constitute Apple’s recommendation or endorsement. Please contact the vendor for additional information.
Published Date: