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
7
votes
1 answer

Subdomain constraint (Rails 3) makes local server (thin) SO SLOW

I recently added a subdomain constraint to my Rails routes file constraints(:subdomain => 'new') do devise_for :customers do get "/customers/sign_up" => "registrations#new" post "/customers" => "registrations#create" put…
Maia Bittner
  • 141
  • 1
  • 5
7
votes
3 answers

How to make Thin run on a different port?

I've a very basic test app. When I execute this command the server ignores the port I specify and runs Thin on port 4567. Why is the port I specify ignored? $ruby xxx.rb start -p 8000 == Sinatra/1.3.3 has taken the stage on 4567 for production with…
Roman
  • 10,309
  • 17
  • 66
  • 101
7
votes
1 answer

Testing HTTPS on Sinatra locally

I need to test how some elements on my page behave when I access it over HTTPS - I was wondering how I could test this sinatra app locally with HTTPS. I apologize if my question doesn't even make sense, but I would like to connect to localhost…
Jordan Scales
  • 2,687
  • 4
  • 28
  • 37
7
votes
1 answer

Safely stopping em-websocket in rails on thin

I have a rails app I am running on thin server to utilize the EventMachine run loop. The problem is that I would like to be able to include em-websocket to process information coming in from a ws and stop and start the websocket without stopping the…
MobileOverlord
  • 4,580
  • 3
  • 22
  • 30
6
votes
1 answer

Error When Restarting Thin for my Ruby on Rails Application

I am trying to use the folling command to restart thin. thin restart -c config/thin.yml Here's the content of thin.yml: rackup: /root/SEHabitat/config.ru pid: /tmp/pids/thin.pid wait: 30 timeout: 600 log: /root/SEHabitat/log/thin.log max_conns:…
Ian Mason
  • 136
  • 12
6
votes
2 answers

Why does a simple Thin server stop responding at 16500 requests when benchmarking?

Possible Duplicate: 'ab' program freezes after lots of requests, why? Here's a simple test server: require 'rubygems' require 'rack' require 'thin' class HelloWorld def call(env) [200, {"Content-Type" => "text/plain"}, "OK"] …
sunkencity
  • 3,482
  • 1
  • 22
  • 19
6
votes
2 answers

How to restart individual servers in thin cluster in rails 3.1 app

I have a thin cluster set up to start 3 servers: /etc/thin/myapp.yml ... wait: 30 servers: 3 daemonize: true ... and the I use thin restart -C /etc/thin/myapp.yml to restart. However, I would like to restart each server at a time, to reduce…
deb
  • 12,326
  • 21
  • 67
  • 86
6
votes
1 answer

Thin and sinatra - how to stop/restart? No thin.pid

I'm using thin as the server for my Sinatra app. It is started thusly: thin -C config/environment.yml -R config/config.ru start Where environment.yml has thin stuff and config.ru has general stuff you'd find in a rackup file. I would like to be…
Hsiu Dai
  • 1,303
  • 2
  • 14
  • 21
6
votes
3 answers

Sinatra Sessions Not Persisting as Expected

I'm trying to use redirects and sessions in Sinatra to pass some data around the site. Here's a simplified example, using PrettyPrint for debugging: require 'pp' require 'rubygems' require 'sinatra' enable :sessions get '/' do session[:foo] =…
Mike Craig
  • 1,677
  • 1
  • 13
  • 22
6
votes
0 answers

With Sinatra+Thin, how to get a specific SSL client certificate suggestion during login?

I am running a small sinatra application which re-uses a company-wide client certificate every employee has already installed (signed by an internal SSO_CA). My Sinatra/Thin combination is using the server certificate signed by an internal company…
bachmarc
  • 95
  • 5
6
votes
2 answers

How to start and stop a Sinatra application using Thin on Windows?

class App < Sinatra::Base def hello "world" end end From documentation I found that I can start the application like this: App.run Although this does not return the control. How do I start the application in the background and how can I…
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
6
votes
2 answers

How to run cucumber selenium using Thin server instead of default Webrick?

my cucumber features with selenium runs (for Rails 3 app) using the default Webrick server. How can I force or setup to run with Thin server instead of Webrick? Any settings to put in env.rb file or else?
millisami
  • 9,931
  • 15
  • 70
  • 112
6
votes
2 answers

How do I run a Sinatra app as a deamon from the command line?

How do I run a Sinatra app as a deamon from the command line? It is using Thin: ruby app.rb -p 3000 -e production I don't like to set it up in the app.rb itself. I want to deamonise it from the command line.
Paul Verschoor
  • 1,479
  • 1
  • 14
  • 27
6
votes
1 answer

How to get ActionController::Live streaming working with Thin?

Question Can you use thin with ActionController::Live to implement Server Side Events (SSE) and long polling? If so, how? Context Although the title is a repeat of How to get Rails 4 ActionController::Live streaming working with Thin and Ruby 2?…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
6
votes
1 answer

Using thin for concurrent requests

I have a Rails 4.1 application with a simple controller which streams a response: class ServerSentEventsController < ApplicationController include ActionController::Live def index response.headers['Content-Type'] = 'text/event-stream' …
David Tuite
  • 22,258
  • 25
  • 106
  • 176