Re: [Trinidad] “Hello World” JRuby/Trinidad/Sinatra App Super Slow

83 views
Skip to first unread message

Tim Olsen

unread,
May 6, 2013, 9:39:31 AM5/6/13
to rails-t...@googlegroups.com
Two things I would check.  

1. Make sure you are running Rails in production mode (either by passing "-e production" to trinidad or by setting "environment: production" in trinidad.yml).  

2. Use the latest version of jruby (currently 1.7.3). 

Tim


On Sat, May 4, 2013 at 2:49 PM, Jonah <jon...@gmail.com> wrote:

I've deployed a "Hello World" sinatra app via trinidad, behind an apache load balancer on an AWS micro instance. When i use apache benchmark, the app will max out the CPU:

ab -kc 20 -n 500 http://mysite.com/
 

Requests take an average of 0.5 seconds to serve, which seems really slow for a hello world app (the same app with nginx/unicorn on MRI is much faster on the same machine).

I also tried load testing it with "siege". The response times were identical, but the CPU was stayed under 20%, presumably because the requests are not concurrent.

I suspect I need to change some simple config option. Thanks for any advice.

Sinatra App


require "sinatra/base"

class MyApp < Sinatra::Base
  get '/' do
     "Hello World"
  end
end

Apache httpd.conf


<Proxy balancer://trini>
  BalancerMember ajp://127.0.0.1:8099
</Proxy>

ProxyPass / balancer://trini/
 

trinidad.yml


ajp:
  port: 8099
  allowTrace: true
web_apps:
  default:
    context_path: /
    web_app_dir: .
 

start trinidad command


jruby -S trinidad --config trinidad.yml

--
Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus correos electrónicos, envía un correo electrónico a rails-trinida...@googlegroups.com.
Para publicar una entrada en este grupo, envía un correo electrónico a rails-t...@googlegroups.com.
Visita este grupo en http://groups.google.com/group/rails-trinidad?hl=es.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages