top | item 33727658

(no title)

r-s | 3 years 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.

discuss

order

mperham|3 years ago

This is utterly false in my experience. The popularity of Puma and Sidekiq mean that threading issues are quickly found and fixed.

dalyons|3 years ago

Yeah I agree. Thread safety in ruby is a non issue these days. Maybe this is 10 years out of date experience?

pdhborges|3 years ago

How does Puma help with the libraries that are not thread safe?

Rapzid|3 years ago

Multiprocess 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|3 years ago

Could JRuby help ?