Hacker News new | past | comments | ask | show | jobs | submit login
MRI Ruby + MySQL + Threads == Stop the world... JRuby doesn't (hungrymachine.com)
13 points by luccastera on Aug 19, 2008 | hide | past | favorite | 3 comments



Solution: deal with MySQL in a separate process and talk to that process asynchronously from your app. A hack, perhaps, but if you need to use threads and Ruby, and Ruby can't call a C extension from multiple threads... this will fix the problem with about 20 minutes of development work. It would of course be better to fix Ruby, but that might take longer.

The least helpful thing to do, though, is to whine about it on your blog. Complain after you've fixed it :P


It's quite disturbing to discover that it isn't just Rails that has the hobbyist-level db implementation.

In fact, there's no point for Rails to improve its lock-happy db adapters, since doing so will just reveal the Ruby bottleneck described here.


This is a good catch. I imagine that the vast majority of requests coming into a given Rails app cause the controller to perform some kind of synchronous data access to MySQL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: