News for hackers. Stuff that matters.
Re:Heroku for Java by typicalrunt on Thursday August 25, 2011 @06:57PM (#2926722)
If they supported git pushing a war file, then I wonder what the performance improvements would be with Warble-ing a RoR app and running it on a JVM?

Edit Oh wait, they already did. But not using a WAR file it seems.

For example, JRuby is one of the most frequently-requested languages on Heroku. Matthew Rodley has already put a Rails app onto JRuby on Heroku by adding JRuby to pom.xml. Scala, another common request, could be done the same way. We do look forward to being able to offer the same kind of first-class support for JRuby and Scala that we offer for Clojure; but in the meantime, bootstrapping via Java is a reasonable strategy.

Now if we could just get some performance comparisons between the Ruby and Java platforms on Heroku... pretty please?

Re:Heroku for Java by khaless on Thursday August 25, 2011 @07:51PM (#2926838)
I'll hook something together this weekend in terms of a benchmark. The nice thing with JRuby is you get the concurrency features of the runtime.
Re:Heroku for Java by kowsik on Friday August 26, 2011 @01:03PM (#2929067)
try dyno-blitzer https://github.com/pcapr/dyno-blitzer which scales up dynos, runs a load test and tells you how many dynos you'll need to support x concurrent users.
Re:Heroku for Java by jshen on Thursday August 25, 2011 @08:08PM (#2926876)
a lot of ruby code isn't threadsafe. I'm pretty sure rails isn't.
Re:Heroku for Java by atambo on Thursday August 25, 2011 @08:16PM (#2926888)
Rails is threadsafe if you turn it on by uncommenting config.threadsafe! in your environment initializer.
Re:Heroku for Java by jshen on Thursday August 25, 2011 @08:38PM (#2926931)
That's not what I mean. That will make it run with concurrent threads per request. However, I'm fairly certain it isn't threadsafe.

Somewhere around 3.0.6 I made a simple jruby rails app and a sinatra app. They were both a thin REST layer over data in mongodb (No AR). I did load testing and the sinatra app ran fine, the rails app would fail on about 7% of requests with seemingly random stack traces. When I reran the tests with config.threadsafe! turned OFF it never failed.

Also, on Bob Lee's OSCON talk he mentioned some unthreadsafe code in AR that he found.

http://www.oscon.com/oscon2011/public/schedule/detail/21092

Re:Heroku for Java by atambo on Thursday August 25, 2011 @09:22PM (#2927011)
I've had good experiences with several jruby on rails apps under tomcat using warbler and they all seem to perform fine with config.threadsafe! enabled. You should probably investigate those stacktraces, maybe they were caused by unthreadsafe gems or application code?
Re:Heroku for Java by jshen on Thursday August 25, 2011 @10:20PM (#2927106)
It would fail without using any gems other than trinidad. I'll try to reproduce it tomorrow.
Re:Heroku for Java by jshen on Friday August 26, 2011 @04:39PM (#2929884)
I'm rerunning it now with the latest rails and latest jruby and all is good.