Message from discussion
Poor performance with JRuby on Rails
Received: by 10.50.197.233 with SMTP id ix9mr622700igc.5.1346913911498;
Wed, 05 Sep 2012 23:45:11 -0700 (PDT)
X-BeenThere: jruby-users@googlegroups.com
Received: by 10.231.62.200 with SMTP id y8ls671040ibh.5.gmail; Wed, 05 Sep
2012 23:45:11 -0700 (PDT)
Received: by 10.42.115.129 with SMTP id k1mr518744icq.28.1346913911397;
Wed, 05 Sep 2012 23:45:11 -0700 (PDT)
Received: by 10.42.115.129 with SMTP id k1mr518742icq.28.1346913911387;
Wed, 05 Sep 2012 23:45:11 -0700 (PDT)
Return-Path: <user-return-17923-jruby-users-garchive-14719=googlegroups....@jruby.codehaus.org>
Received: from mail.codehaus.org (mail.codehaus.org. [63.246.24.167])
by gmr-mx.google.com with ESMTPS id rf8si470923igb.2.2012.09.05.23.45.11
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 05 Sep 2012 23:45:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of user-return-17923-jruby-users-garchive-14719=googlegroups....@jruby.codehaus.org designates 63.246.24.167 as permitted sender) client-ip=63.246.24.167;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of user-return-17923-jruby-users-garchive-14719=googlegroups....@jruby.codehaus.org designates 63.246.24.167 as permitted sender) smtp.mail=user-return-17923-jruby-users-garchive-14719=googlegroups....@jruby.codehaus.org
Received: (qmail 5633 invoked by uid 89); 6 Sep 2012 06:44:50 -0000
Mailing-List: contact user-h...@jruby.codehaus.org; run by ezmlm
Precedence: bulk
List-Post: <http://xircles.codehaus.org/manage_email>
List-Help: <http://xircles.codehaus.org/manage_email>
List-Unsubscribe: <http://xircles.codehaus.org/manage_email>
List-Subscribe: <http://xircles.codehaus.org/manage_email>
List-Id: <user.jruby.codehaus.org>
Reply-to: u...@jruby.codehaus.org
Delivered-To: mailing list u...@jruby.codehaus.org
Received: (qmail 5627 invoked by uid 89); 6 Sep 2012 06:44:50 -0000
Received-SPF: pass (63-246-24-167.contegix.com: SPF record at ruby-forum.com designates 188.40.52.210 as permitted sender)
Old-Return-Path: <li...@ruby-forum.com>
Date: Thu, 06 Sep 2012 08:44:48 +0200
From: Darshan Karandikar <li...@ruby-forum.com>
To: u...@jruby.codehaus.org
Message-ID: <e8380e5a6e0b59d0bc0e6dd890602...@ruby-forum.com>
In-Reply-To: <cf53e8a02ae5a4a6ee267718f166b...@ruby-forum.com>
References: <cf53e8a02ae5a4a6ee267718f166b...@ruby-forum.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Errors-to: li...@ruby-forum.com
Subject: [jruby-user] Re: Poor performance with JRuby on Rails
Suggest you to go through http://www.ruby-forum.com/topic/1119702 where
I have shared my experience with JRoR. I also had faced performance
issues in the beginning. Summarizing the configs that solved the
problems for me:
1) Write thread-safe code and enable config.threadsafe! in Rails. Gave
me the best performance and scalability.
2) Increase the AR conn. pool wait timeout.
3) Warm up AR conn. pool by either using AR-JDBC bridge OR following
custom script (helps prevent the overhead of creating db conns at
runtime which was one bottleneck in my case):
#db pool warmup
puts "db pool warmup starting...................... #{Time.now}"
warm_up_count = APP_CONSTANTS['dbconn_warm_up_count'].to_i
conn_array = Array.new
for i in 1..warm_up_count do
conn_array[i] = ActiveRecord::Base.connection_pool.checkout
puts 'chekedout '+i.to_s+'......................'
end
puts 'warmed up...........==============..............'
for i in 1..warm_up_count do
ActiveRecord::Base.connection_pool.checkin(conn_array[i])
puts 'chekedin '+i.to_s+'......................'
end
puts "db pool warmup done........................... #{Time.now}"
--
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email