Performance optimization guide for Chatwoot self-hosted deployments
WEB_CONCURRENCY
environment variable can be used to configure the number of workers in Puma. It’s important to consider the number of available CPU cores and aim for a ratio of workers to cores that allows the server to run at maximum capacity without causing performance issues. It’s recommended to have a number of workers that matches or is slightly less than the number of available CPU cores to avoid competition for CPU time, which can lead to performance issues.
WEB_CONCURRENCY
is 0
. I.e. it runs one Worker. This is to ensure the application works on machines with a lower configuration. If you run Chatwoot on machines with higher specs, fine-tune this configuration accordingly.RAILS_MAX_THREADS
values is 5
. You can fine-tune it based on your requirements. The value of RAILS_MIN_THREADS
defaults to RAILS_MAX_THREADS
unless a specific value is provided.WEB_CONCURRENCY
to the number of CPU cores and then fine-tune the number of RAILS_MAX_THREADS
based on the available memory
and CPU
resources. While running the sidekiq and rails server on a single machine, consider the sidekiq configuration while determining these numbers.
References:
SIDEKIQ_CONCURRENCY
number to extract the maximum performance of the available CPU resources.RAILS_MAX_THREADS
and SIDEKIQ_CONCURRENCY
ActiveRecord::ConnectionTimeoutError
errors.rack-timeout
, in specific installations, which results in connections not being released properly. For the time being, you can set the following environment variable to disable rack-timeout
if you are experiencing this.