5 ms·
Thread safety in Rails is a total pain in the ass. So many libraries out there are not thread safe. I have worked with many large rails codebases and there alwa
by r-s 4y ago
Thread safety in Rails is a total pain in the ass. So many libraries out there are not thread safe. I have worked with many large rails codebases and there always are gems that somehow work their way in with major threading issues. I think its a legitimate strategy to run rails apps single threaded and multi process. Not necessarily for all apps or workloads of course.
- Rapzid 4y agoMultiprocess is more often than not better for latency anyway. Otherwise a big serialization or other cpu clog will block up the other, potentially quick, requests on the same process. Much has been written about this.
- revskill 4y agoCould JRuby help ?
- mperham 4y agoThis is utterly false in my experience. The popularity of Puma and Sidekiq mean that threading issues are quickly found and fixed.
- pdhborges 4y agoHow does Puma help with the libraries that are not thread safe?
- sparker72678 4y agoI think he's saying threading issues are more likely to be found and fixed these days given the context in which most ruby libraries are running.
- dalyons 4y agoYeah I agree. Thread safety in ruby is a non issue these days. Maybe this is 10 years out of date experience?