[Mongrel] Threading & database connections.
jjones at raindrop.co.uk
Wed Mar 1 11:34:54 EST 2006
Thank you for the reply. It does shed some light on things.
> If you check the code in mongrel_rails, you will see that because
> rails isn't "thread-safe", a Mutex was used to avoid controllers from
> executing simultaneously. The number of active connections shouldn't
> be different from webrick.
I have run the server with the -n 1 Parameter for a while now and it only uses two
connections (as it should). Because of this I am drawing the following conclusion.
1. (Most likely) My code is somehow buggering up ( I am a beginner after all).
2. Rails is somehow thinking that there is no DB connection when run from a second thread due to a rails bug.
2. Rails is somehow thinking that there is no DB connection when run from a second thread due to the way the MUTEX is coded. (I haven't looked at the source code, being a beginner it probably wouldn't help)
I will see if I can find out more but this is a personal project so I can only do it at lunchtime.
More information about the Mongrel-users