Docker single server - performance issues

Performance of sites belonging one of the bench in a single server setup is drastically reduced.

Yesterday the sites from one of bench were timing out. Pulling down the container and making it up made the sites accessible.
However the sites have become very slow. Reports that used to run in 3-4 seconds now take more than 30 secs. Navigating anything is delayed.

Checked the resources of the VM. It is a 8GB VM with 8GB Swap.

Sites of other benches are working fast as usual. There is no issue with other sites.

How should the performance be improved

Docker specific:
Try docker stats to check which container is consuming resource. Once you know, debug that process.

General (not specific to containers):

  • most likely, gunicorn making blocking db calls from custom app.
  • check, rq workers doing something heavy from custom app freezing everything on VM
2 Likes

Thanks @revant_one
Yes i inspected the backend container of the respective bench by

docker stats <container id of backend>

I also did a htop to identify the most expensive processes. As you said it is gunicorn which was consuming lot of resources.

I restarted the container. It solved the problem.

docker restart <container id of backend>

so far no issues.