Hi,
is there a way how to improve Python performance in Kubernetes (containerd)? We make some tests using the same code and it looks like in the container it executes twice slower than on bare metal.
Are there any resource restrictions specified for the container, like memory and CPU?
Is it CPU, memory or I/O bound?
If it’s I/O bound, is it network or storage, read or write?
You have to provide more info.
It is a small container with celery application and there is a script in Python for healthcheck verify of the app. Generally, I think, it is not related directly to Python, but for all codes. We had also a bash script wich have only one line of code, but the situation is the similar - works slowly.
#!/bin/sh
celery -A celery:celery_application inspect ping -d HOSTNAME
Well, I think these restrictions are quite tight… 50% of a single CPU core for a whole Celery worker? How many parallel processes it runs?
As a rule, you should have 1 CPU core per process, including the root and all child processes. If the code you run is I/O bound, you can try with less CPUs.
Show me at least the container command.
Regarding the Bash script, it’s a single line but under the hood it invokes Python with the Celery command code