Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerized container consuming too much CPU resource #14

Closed
kweng2 opened this issue Sep 29, 2020 · 9 comments
Closed

Dockerized container consuming too much CPU resource #14

kweng2 opened this issue Sep 29, 2020 · 9 comments

Comments

@kweng2
Copy link

kweng2 commented Sep 29, 2020

Building docker image from source then running in container as suggested results in consuming ~100% of CPU:

docker build ./ -t tasks_emulator
docker run -p 8123:8123 tasks_emulator -host 0.0.0.0 -port 8123 -queue projects/dev/locations/here/queues/anotherq

I have not tried running this via go directly.

@aertje
Copy link
Owner

aertje commented Sep 30, 2020

Hi @kweng2, I tried to reproduce this but haven't been able to, either in a docker container or running it straight up.
Do you observe this behaviour simply after starting the emulator (i.e. even when it's not executing any tasks or anything)?

@aertje
Copy link
Owner

aertje commented Nov 26, 2020

If anyone else experienced this behaviour, can you please provide some more information under what conditions this was observed? Thanks!

@acoulton
Copy link
Contributor

FWIW I haven't observed any issues. We have it running in our CI cluster under k8s, and monitoring is showing consistently tiny CPU usage for that pod. It's not handling a lot of tasks yet, it's a clean pod for every build and we purge the queue for each scenario, so it's maybe not 100% representative.

@Thammada
Copy link

I'm running it from docker-compose on macOS 11.0.1
For a single queue, the average CPU usage is around 10% for an idle queue (while not 100% as the OP, but I still think it's a bit too high for an idle queue).
For my application, I need 12 separate queues and the container uses around 120% CPU resource, which is a bit too high for local development.

@aertje
Copy link
Owner

aertje commented Nov 28, 2020

Ok, I'm also seeing an increase in CPU consumption when i add a queue, but only about 1% per queue. At first I suspected the max concurrent dispatches (as it creates a go routine for each) but i created one with 1 million without any noticeable increase in CPU, so that does not seem to be it.
Will keep looking.

@aertje
Copy link
Owner

aertje commented Dec 10, 2020

Possibly related: docker/for-mac#5044

@aertje
Copy link
Owner

aertje commented Dec 19, 2020

I've merged @phalimee's fix; please let me know if you are seeing an improvement in CPU consumption with this @kweng2 and @Thammada.

@Thammada
Copy link

@aertje I'm observing an average of 0.00% CPU utilization on idle queues and around 1-3% for active queues 👍👏🎉

@aertje
Copy link
Owner

aertje commented Dec 22, 2020

Thanks @Thammada, will close this issue then.

@aertje aertje closed this as completed Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants