multi-threading issues

29 views
Skip to first unread message

Martin Guetlein

unread,
May 5, 2011, 3:06:30 AM5/5/11
to Ohm Ruby
Hi all,

thanks for this useful tool. I am using ohm and redis as database
backend for a sinatra web service application. Things are working fine
as long as I do not try to make several requests at a time.

Simultaneous high-load tests cause the following problems:
* sometimes ohm models are nil (i.e. loaded via find, they do exist)
* sometimes the model itself is loaded, but attributes are nil
* once I got: Resource temporarily unavailable - Timeout reading from
the socket

I am using Ohm.connect :thread_safe => true. I read in the
documentation that "it is recommended to use a different instance per
thread".
Does anyone has an example for that?
I think that I am already doing that, a bit more on my setup: I have
an nginx web-server running, with the puhsion-passenger plugin, with
passenger_spawn_method set to conservative. Accordingly each request
to my service, is handled in an seperate Ruby application process ->
each process has its own Ohm instance.

Help would be very much appreciated, I dont really know how to
proceed,

Best regards,
Martin

Damian Janowski

unread,
May 5, 2011, 10:09:37 PM5/5/11
to ohm-...@googlegroups.com

Can you join #ohm on Freenode? We can help you debug the issue.

Reply all
Reply to author
Forward
0 new messages