On Aug 27, 8:18 am, Gianluca Tessarolo <[email protected]> wrote: > Sorry, I still can't understand how to run rails in thread safe mode > under JRuby (one running instance supporting multiple concurrent requests). > > If I try to enable config.threadsafe! in > config/environments/production.rb under Glassfish Gem my Rails > application still run single threaded. > edit config/glassfish.yml, modify config as follow (notice 4 runtime > instances !): > > environment: production > jruby-runtime-pool: > initial: 4 > min: 4 > max: 4
I think this is your mistake. You told Rails to run in threadsafe mode, which Glassfish gem will pick up; but then you forced Glassfish to run with a runtime pool of 4 instances. If you *don't* do this it works fine, and your four concurrent requests all take the same amount of time (10s) to run because they're running in parallel. The only bottleneck you might run into with this contrived example is that GF by default only has a certain size thread pool, and will start to park requests until one of the request-processing threads is available, but you can crank that up too if needed. I assure you, Rails on JRuby runs great in threadsafe mode, with only a single runtime. You can crank thousands of requests through a single instance, something impossible to do with any other Ruby implementation so far. - Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

