How to Modify CPU Core Usage in lcore for Large Instances¶
WHAT TO EXPECT
There is a known issue where users with large instance types experience reduced performance. To solve this issue, users can manually modify their CPU core usage to ensure an optimal thread configuration.
Prerequisites
- Aim to use only one CPU per core to maximize efficiency.
- Restrict usage to CPUs from the same socket, most likely from SOCKET 0.
- Try not to use more than 14 CPUs as listed in the lcores setting.
If you have any questions or concerns, please contact support@swxtch.io before attempting reconfiguration.
-
Check your core topology by using the following command on your cloudSwXtch VM:
Example Output:
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ 0 0 0 0 0:0:0:0 yes 2800.0000 800.0000 1 0 0 0 0:0:0:0 yes 2800.0000 800.0000 2 0 0 1 1:1:1:0 yes 2800.0000 800.0000 3 0 0 1 1:1:1:0 yes 2800.0000 800.0000 4 0 0 2 2:2:2:0 yes 2800.0000 800.0000 5 0 0 2 2:2:2:0 yes 2800.0000 800.0000 6 0 0 3 3:3:3:0 yes 2800.0000 800.0000 7 0 0 3 3:3:3:0 yes 2800.0000 800.0000As you can see, CPU 0&1 are on the same core 0, CPU 2&3 are on the same core 1, etc. The recommendation is to use one CPU of each core.
-
Adjust your thread assignment by editing the
/var/opt/swxtch/lcores_config.jsonconfiguration file. This file specifies which CPU your application should use.This is an example of the format you can use in lcores_config.json: