Ctrl K
Python · Senior · System design

Your Django service runs under gunicorn, and on every server the workers eat up all the memory. How would you design the worker configuration, and what would you do about memory consumption?

~10 min by voice

How to approach it

The interviewer wants to see whether you understand gunicorn's process model and how memory works in CPython (fork, copy-on-write, refcounts), whether you measure the problem first and then choose the type and number of workers based on real resources rather than a template formula.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsВаш процесс на сервере с 16 гигабайтами памяти показывает в top VIRT 40 гигабайт, RES 2 гигабайта, а потом его внезапно убивает OOM killer. Объясните, как устроена память процесса в Linux, что означают эти цифры и как процесс мог дойти до OOM. Mid-levelOver a day of running, a Python worker grows in memory from two hundred megabytes to three gigabytes. How would you track down the leak? Mid-levelHow does memory management work in CPython? And how would you track down a memory leak in a long-running Python process? SeniorHow does memory management work in Python? How are objects that are no longer needed removed? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~10 min