Frappe_docker production setup -> How to increase RQ Worker?

I build my custom image, and run production env by this repo.

I think most of the features seem to work well.

But, I don’t know how to increase my RQ Worker.

When I was using supervisorctl,
Just set background_worker into common_site_config.json
and restart → RQ Worker was increased.

But now, I’m using docker container, production env,
set “background_worker” into common_site_config is not working.

CleanShot 2024-02-16 at 13.09.30

I tried adding the number of deployments like this to the compose file, but it doesn’t seem to have been applied.

Anyone can help?

1 Like

I think it’s because all the PIDs running docker containers are 1. Is there a way to fix the problem?

All of the container PID is 1…
So the PID of the RQ Worker is 1 every time it refreshes, the short default long alternates.

The RQ Worker report says something like this,
Only the PID is the same, is it working normally?

Hi @MinHyeong-Lee,

Do you have any update on this topic?
Did you figure out how to increase the number of RQ workers?

Hi @lequockhanh

Yes, I successfully increased the number of rq workers.


Just edit the replicas value in the compose yaml file as shown in the photo above.
Note that the scheduler should not increase replicas.

I think that the fact that the PID looks the same as 1 is an inevitable part of the nature of the container. This is because the root PID on which the replica container runs is 1. However, this is not a problem and works normally.

1 Like

PID 1 problem was solved a while ago, we show all workers in RQ worker doctype now.

Thanks @MinHyeong-Lee for your detailed answer.

Thanks @ankush for the update. I upgraded to the newest version and saw all the RQ workers in the list now.

I have another question related to RQ Worker. I posted it here.
If you guys can take a look and give some advice, I’d be so appreciative.