We kept getting this message on our forum. (like every 3-4 hours). We have 16 cores of CPU and 32GB of ram. I don’t think the resources is an issue.
Oops
The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.
Detailed information about the error was logged, and an automatic notification generated. We'll take a look at it.
No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site's feedback category.
The production log shows
app/models/user_auth_token.rb:125:in `lookup'
lib/auth/default_current_user_provider.rb:131:in `current_user'
lib/current_user.rb:35:in `current_user'
app/controllers/application_controller.rb:1047:in `rate_limit_crawlers'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-silence_logger.rb:27:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:236:in `call'
Unexpected error in Message Bus : ActiveRecord::ConnectionNotEstablished : connection to server at "172.17.0.2", port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections
Unexpected error in Message Bus : ActiveRecord::ConnectionNotEstablished : connection to server at "172.17.0.2", port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections
Unexpected error in Message Bus : ActiveRecord::ConnectionNotEstablished : connection to server at "172.17.0.2", port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections
Unexpected error in Message Bus : ActiveRecord::ConnectionNotEstablished : connection to server at "172.17.0.2", port 5432 failed: FATAL: remaining connection slots are reserved for non-replication superuser connections
We set the following config in
UNICORN_WORKERS: 32
UNICORN_SIDEKIQS: 2
and for psql
db_shared_buffers: "4096MB"
Please let me know what else I can do to improve the config and make sure the server won’t crash.