Search
English

Why Kubernetes Pod memory requests and limits should be set equal, as summarized by a Japanese developer(zenn.dev)

startupxo Discuss

Writing language: KoreanRead in the original language

Plain summary

- Kubernetes distributes apps across servers (Nodes) in units of Pods. The scheduler decides placement by looking only at the total of the memory requests that Pods have reserved in advance, not at the server's actual memory usage. - If limits are set higher than requests, the sum of limits can exceed the server's real memory, which is overcommit. Memory cannot be reclaimed, so when it runs short, processes are forcibly killed, and the author ntk explains that there is no guarantee the Pod using the most memory dies first. - An overcommitted server looks like it has spare capacity on paper, so Pods do not become Pending. The cluster autoscaler, which adds servers based on Pending Pods, also does not act, so forced kills may repeat, the article says. - ntk argues that setting the two values equal means only the Pod that exceeds its amount is killed, which makes finding the cause easier. Because every Pod on the same server must follow this, ntk recommends enforcing it across the whole cluster with tools such as LimitRange. - According to an opinion from a practitioner quoted in the original, for apps that use a lot of memory only at startup, setting the two values equal greatly lowers resource efficiency. Grouping such exception apps on specific servers and tuning them was raised as an option.

Read source ↗

Found on

Zenn ↗ / Published by source

Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.

Sign in to comment

Keyboard shortcuts

Choose a post with J and K or the arrow keys, then press Enter.

K ↑ / J ↓
Previous post / next post
Enter C
Open summary and comments for the selected post
O
Open the original link of the selected post
/
Search
?
Show this help
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.