How to Modify CPU Core Usage in lcore for Large Instances

Prev Next

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.

  1. Check your core topology by using the following command on your cloudSwXtch VM:

    lscpu --extend --all

    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.0000
  2. Adjust your thread assignment by editing the /swxtch/lcores.json configuration file. This file specifies which CPU your application should use.

    This is an example of the format you can use in lcores.json:

    {
        "lcores": "1,3,4,6,8-12"
    }