I was making the assumption that Thin like Unicorn can be told how many workers it should spawn, and so be controlled. Although that would only have worked between deploys when things kicked off again
And obviously you'd then need to coordinate between dynos as you suggested, so its certainly less trivial than I first thought
Daniel Barber
@danbee
Thin is evented, so it doesn't really have the concept of threads or workers
Baris Balic
@barisbalic
Then I was totally wrong from the outset
Daniel Barber
@danbee
Not sure how that relates to the number of database connections, but I would have thought 1 per dyno
Also, we're assuming codebar.io runs on Thin ;)
Baris Balic
@barisbalic
I don't know how many you get etc, just assumed that Heroku would know that + dyno count + threads/workers/things needing connnections, and then be able to dyna,dynamically allocate and reallocate, but I dont think thats anywhere near as simple as I was suggesting
Daniel Barber
@danbee
You get a maximum number of database connections depending on what tier you choose for your PostgreSQL instance
Both the hobby tiers max out at 20 connections
Baris Balic
@barisbalic
Sounds familiar
Daniel Barber
@danbee
Sounds like the connection pool defaults to 5 per dyno. At least that's what it is on one of my basic Heroku apps!
Baris Balic
@barisbalic
I really thought they were going ahead with the Thin injection
Daniel Barber
@danbee
So any more than 4 dynos = too many DB connectins
Baris Balic
@barisbalic
yeah
Despo Pentara
@despo
well you know, anyone up for helping im up for granting heroku access. just saying.
hint :P
Baris Balic
@barisbalic
happy enough to move it over to unicorn :D
Despo Pentara
@despo
no pressure
Daniel Barber
@danbee
@despo Happy to take a look!
Despo Pentara
@despo
emails plese, dm might be better as the chat is always visible
Daniel Barber
@danbee
@barisbalic Puma is good on Heroku as it is threaded
Baris Balic
@barisbalic
@danbee ahh I recall reading about it being design for rubinius but still performant under MRI
Daniel Barber
@danbee
I wasn't aware of it being designed for Rubinius
Ah: "Second, Puma is designed to be used on a Ruby implementation which provides true parallelism, such as Rubinius and JRuby."