Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Many Database Connections Will ActionCable Open?

I've been trying out ActionCable and was wondering how many database connections it will attempt to open. Will it be one per instance or one per consumer connection? Having 100k consumers with a database connection opened for each would crush the database.

like image 252
Artem Kalinchuk Avatar asked Oct 15 '25 15:10

Artem Kalinchuk


1 Answers

It depends on the worker pool. If you worker pool is set to 100 then 100 database connections it can open. ActionCable::ServerWorker::ActiveRecordConnectionManagement takes care to ensure connections are checked back into the pool.

like image 188
Mohammad Shahadat Hossain Avatar answered Oct 17 '25 04:10

Mohammad Shahadat Hossain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!