<p>I create my docker (python flask).</p>

<p>How can I calculate what is the limit to put for memory and CPU?</p>

<p>Do we have some tools that run performance tests on docker with different limitation and then advise what is the best limitation numbers to put?</p>

<p>With an application already running inside of a container, you can use <code>docker stats</code> to see the current utilization of CPU and memory. While there it little harm in setting CPU limits too low (it will just slow down the app, but it will still run), be careful to keep memory limits above the worst case scenario. When apps attempt to exceed their memory limit, they will be killed and usually restarted by a restart policy/orchestration tool. If the limit is set too low, you may find your app in a restart loop.</p>
