Questions tagged [thin]

Thin is an EventMachine-based web server written in Ruby for running Rack-based web apps.

Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history:

the Mongrel parser, the root of Mongrel speed and security Event Machine, a network I/O library with extremely high scalability, performance and stability Rack, a minimal interface between webservers and Ruby frameworks Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server bundled in an easy to use gem for your own pleasure.

695 questions
6
votes
1 answer

How to start bunny thread in Rails and Thin

I'm integrating Bunny gem for RabbitMQ with Rails, should I start Bunny thread in an initializer that Rails starts with application start or do it in a separate rake task so I can start it in a separate process ? I think if I'm producing messages…
Moustafa Samir
  • 2,248
  • 1
  • 25
  • 32
6
votes
1 answer

Rack Sessions getting lost in Chrome

I have an pretty simple app hosted on EC2 built with Sinatra, served with thin behind nginx. The problem is that with Chrome, the session variables get 'lost' in Sinatra. It does not happen in Firefox. This is using Rack::Session::Cookie. This is…
Sam M
  • 61
  • 2
6
votes
2 answers

Sinatra: Undefined method bytesize for Hash

I'm creating a Sinatra app that takes an uploaded CSV file and puts its contents in a hash. When I reference this hash in my app.rb like so: hash = extract_values(path_to_filename) I keep getting this error message: undefined method `bytesize' for…
fullstackplus
  • 1,061
  • 3
  • 17
  • 31
6
votes
1 answer

Can Apache BalancerMember be configured to use unix domain sockets?

I am using the Apache Proxy balancer directive to hook up a set of thin servers (for Rails). Like so: BalancerMember http://127.0.0.1:5000 route=thin0 BalancerMember http://127.0.0.1:5001 route=thin1 …
Mike Berrow
  • 2,546
  • 1
  • 20
  • 16
6
votes
3 answers

Choosing application server for API backend

With so many choices for the application server (Passenger, Thin, Unicorn, Mongrel, Puma and Rainbows!), I'm wondering what would be appropriate for the following scenario: Rails is used purely for API backend (all assets are served with Nginx).…
randomguy
  • 12,042
  • 16
  • 71
  • 101
6
votes
2 answers

Updating assets without restarting rails server

So the question basically boild down to this: How do you efficiently handle changing assets in a production rails environment without the need to restart the server? The problem we're experiencing is, we have to restart the Thin server that runs the…
deRailed
  • 579
  • 1
  • 4
  • 9
6
votes
1 answer

Why would you start multiple thin servers?

In the Thin website: http://code.macournoyer.com/thin/usage/ it says that you can start multiple servers using: thin start --servers 3 Why would you need to do this? Is each server assigned a different port or something?
Albert Peng
  • 69
  • 1
  • 2
6
votes
1 answer

Thin::Server#daemonize exits immediately

I trying to make an executable, which starts a Sinatra application via Thin as a daemon. I am using this code to invoke Thin with the Sinatra app: #!/usr/bin/env ruby require 'thin' require 'app.rb' server = ::Thin::Server.new('127.0.0.1', 9999,…
benzimmer
  • 288
  • 2
  • 5
6
votes
1 answer

Rails development server, PDFKit and multithread

I have a rails app that uses PDFKit to render pdf versions of webpages. I use Thin as a development server. The problem is that when i'm in development mode. When I start my server with "bundle exec rails s" and I try to render any PDF the whole…
Rafa de Castro
  • 2,474
  • 1
  • 24
  • 44
5
votes
1 answer

Thin raises missing template exceptions rarely

On my prod server I'm getting Missing template exceptions sometime. The setup is VPN with CentOS5, ruby 1.9.2, Rails 3.2.1, 8 nginx instances, 6 thin instances So, this happens with two main views, happens rarely, approx. 1 time per 1000 requests,…
Wile E.
  • 1,213
  • 1
  • 12
  • 26
5
votes
2 answers

How to mount static files for Rack

I want to serv static files as well as dynamic contents through Rack. Previously, I used WEBrick without using Rack, with code like this, and it worked: @s = WEBrick::HTTPServer.new( Port: 3000, BindAddress: "localhost", …
sawa
  • 165,429
  • 45
  • 277
  • 381
5
votes
1 answer

Can't configure thin to start at system boot on CentOs

I can't configure thin to start at system boot, I am new to Linux I have CentOS 5.7 Thin gem was installed and thin was installed too. sudo gem install thin sudo thin install and when I try to configure thin to start at system boot I get an…
Mesbah
  • 83
  • 1
  • 6
5
votes
1 answer

Why does Ruby run so much slower on windows server than on windows dev machine?

First of all, I would switch to Linux if I could, but I can't, due to a 3rd party dependency. I'm in the process of finishing and deploying a rails app onto a windows 2008 server. While testing on the server the app is proving to be painfully slow,…
Russell
  • 12,261
  • 4
  • 52
  • 75
5
votes
1 answer

Rails ignoring config.action_dispatch.x_sendfile_header? Using Thin + Nginx

I've set up a production environment running Rails 3.1.0rc6, Thin and Nginx. For some reason, having set config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" in config/environments/production.rb, Rails seems to have completely ignored it;…
unrelativity
  • 3,670
  • 6
  • 38
  • 63
5
votes
2 answers

Heroku RACK_ENV says "development" on Thin, but "staging" on Unicorn

I came across this behavior and was wondering if anyone else had seen it. I have a workaround so it's not a show-stopper. I created a new app on Heroku with a Cedar stack. When demonstrating multiple environments I added the following config var:…
wjklos
  • 51
  • 1
  • 3