3.2. Configuring emulator threads
Compute nodes have overhead tasks associated with the hypervisor for each instance, known as emulator threads. By default, emulator threads run on the same CPUs as the instance, which impacts the performance of the instance.
You can configure the emulator thread policy to run emulator threads on separate CPUs to those the instance uses.
To avoid packet loss, you must never preempt the vCPUs in an NFV deployment.
Log in to the undercloud as the
- Open your Compute environment file.
To reserve physical CPU cores for instances that require CPU pinning, configure the
NovaComputeCpuDedicatedSetparameter in the Compute environment file. For example, the following configuration sets the dedicated CPUs on a Compute node with a 32-core CPU:
parameter_defaults: ... NovaComputeCpuDedicatedSet: 2-15,18-31 ...
For more information, see Configuring CPU pinning on the Compute nodes.
To reserve physical CPU cores for the emulator threads, configure the
NovaComputeCpuSharedSetparameter in the Compute environment file. For example, the following configuration sets the shared CPUs on a Compute node with a 32-core CPU:
parameter_defaults: ... NovaComputeCpuSharedSet: 0,1,16,17 ...注記
The Compute scheduler also uses the CPUs in the shared set for instances that run on shared, or floating, CPUs. For more information, see Configuring CPU pinning on the Compute nodes.
Add the Compute scheduler filter
NovaSchedulerDefaultFiltersparameter, if not already present.
Add your Compute environment file to the stack with your other environment files and deploy the overcloud:
(undercloud)$ openstack overcloud deploy --templates \ -e [your environment files] \ -e /home/stack/templates/<compute_environment_file>.yaml
Configure a flavor that runs emulator threads for the instance on a dedicated CPU, which is selected from the shared CPUs configured using
(overcloud)$ openstack flavor set --property hw:cpu_policy=dedicated \ --property hw:emulator_threads_policy=share \ dedicated_emulator_threads