.. _scaling-rhodecode: ============================== Scaling to handle more traffic ============================== scaling http traffic ++++++++++++++++++++ In case for bigger setups docker-compose can scale more rhodecode/vcsserver workers: Adjust the .custom/docker-compose-apps.override.yaml file and change `replicas: NUM` .. code-block:: yaml services: rhodecode: deploy: # set number of instances of services to be spawned on stack start replicas: 4 vcsserver: deploy: # set number of instances of services to be spawned on stack start replicas: 4 Generally replicas of vcsserver and rhodecode should be equal, but each replica should have `workers=N` directive set to `workers=2` for rhodecode `workers=3` for vcsserver. Then scale docker replicas without any downtime using this command .. code-block:: bash ./rcstack stack rhodecode up --detach --no-recreate --scale rhodecode=4 --scale vcsserver=4 scaling ssh traffic +++++++++++++++++++ ssh workers can scale independently from the http traffic handled by rhodecode/vcsserver. To scale for more ssh traffic, increase replicas for sshd service .. code-block:: yaml services: sshd: deploy: # set number of instances of services to be spawned on stack start replicas: 4 scaling celery workers ++++++++++++++++++++++ celery workers can scale independently from the http traffic handled by rhodecode/vcsserver. To scale for more celery task processing capabilities, increase replicas for celery service. .. code-block:: yaml celery: sshd: deploy: # set number of instances of services to be spawned on stack start replicas: 4 .. note:: Celery already has an autoscaler defined by the command argument called `"--autoscale=20,2".` This means that there are min of 2 processes per worker that can scale upto 20 if there are more tasks to process. Scaling replicas means the maximum task processing capacity would be defined by replicas * maximum autoscale number.