Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CloudConf Italy - A Tale of Tail Latency

Ara
June 19, 2024

CloudConf Italy - A Tale of Tail Latency

Ara

June 19, 2024
Tweet

More Decks by Ara

Other Decks in Programming

Transcript

  1. A Tale of Tail Latency Ara Pulido @arapulido (Understanding Kubernetes

    CPU Requests and Limits For Sustainability and Profit)
  2. Datadog is a platform that helps companies improve observability and

    security of their infrastructure and applications
  3. @arapulido What if I set no requests? Creating a pod

    without CPU requests or limits will effectively allow it to be scheduled on any suitable node, regardless of the amount of CPU left on that node. In practice, it will still get some minimal CPU guarantees.
  4. @arapulido kubernetes.cpu.usage.total kubernetes.cpu.requests Type: gauge. Number of nanocores used. High

    cardinality, including pod_name, container_name, container_id. Type: gauge. Number of nanocores requested. High cardinality, including pod_name, container_name, container_id. Metrics to watch
  5. @arapulido container.cpu.throttled container.cpu.throttled.periods Type: gauge. The total cpu throttled time

    (nanoseconds) High cardinality, including pod_name, container_name, container_id. Type: gauge. The number of periods during which the container was throttled High cardinality, including pod_name, container_name, container_id. Metrics to watch
  6. @arapulido • All cores are shared • A workload task/thread

    can migrate from one CPU to another, as the kernel scheduler sees fit none CPUManager
  7. @arapulido • All cores are shared • A workload task/thread

    can migrate from one CPU to another, as the kernel scheduler sees fit • Linux CPUSets • Exclusive access to cores • Caveat: exclusive access only applies to containers (not system processes) none static CPUManager
  8. @arapulido Example of pod with exclusive CPUs Requests = Limits

    Both CPU and memory requests / limits are set CPU request is an integer
  9. @arapulido Metrics to watch container.cpu.limit Type: gauge. maximum CPU time

    available to the container (in nanocores) High cardinality, including pod_name, container_name, container_id. Min(container limit, host capacity - static assignments)
  10. @arapulido CPU requests are not only used to schedule pods

    on nodes They will also be used to proportionally distribute CPU time in case of contention CPU limits will affect your application performance But your container will keep running (not evicted). It will be throttled CPU pinning can be helpful for certain applications But take into account that the amount of CPU available for the rest of applications on the same node will be reduced Summary