Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-10187

Apisonator: Improve CPU detection for the listener workers number

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Backend
    • None
    • False
    • None
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started

      This is the same as THREESCALE-10167 but it's only for apisonator.

      One outcome of the investigation of THREESCALE-10003 was that OpenShift moved to cgroups-v2 since OCP 4.14 (see OCPSTRAT-696).

      System depends on some cgroups v1 files to detect the CPU shares for calculating the appropriate number of Unicorn workers (the value can be overriden by UNICORN_WORKERS and UNICORN_WORKER_MULTIPLIER env vars).

      Specifically, the code checks the value of /sys/fs/cgroup/cpu/cpu.shares which is not present when using cgroups-v2. Instead of CPU shares, CPU weight is used.

      More information about this change: https://linuxera.org/cpu-memory-management-kubernetes-cgroupsv2/#cpu-bandwidth-configuration-on-the-node
      The article also has some links to the kubernetes source code. Particularly, these are interesting:

      We probably need to find a better way to detect the amount of available (requested) CPU, independently of the cgroups version used by the cluster.

              Unassigned Unassigned
              rhn-support-dmayorov Daria Mayorova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: