thin

Starting thin server on different ports

廉价感情. 提交于 2019-11-30 21:02:44
I'm a newbie o thin. I have a ruby on rails application. Today I can start the application normally, by the command sudo thin start -d We have created a new database for tests. (one is a clean database, and he other is for testing so can be messed up) on the database.yml file. I would like to start the same application in two different ports using the different databases. To start an application with the database I can use the ENV option of thin: sudo thin start -d -e production -p 3040 It woks fine. But when I try to start the 'regular' server, it says thins is already running. How could I

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

ぃ、小莉子 提交于 2019-11-30 14:14:18
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"] end end Rack::Handler::Thin.run HelloWorld.new, :Port => 9294 #I've tried with these added too, 'rack.multithread' => true, 'rack.multiprocess' => true Here's a test run: $ ab -n 20000 http://0.0.0.0:9294/sdf This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software

Thin server: ouput rails application logs to console, as 'rails s' does

你离开我真会死。 提交于 2019-11-30 14:03:35
I need to run thin start or thin -ssl ... start within the root of my rails app, and see the application logs output to the console, similar to what rails s does In config.ru file, located at the root of your application, add the following code, just before the line run Rails.application : console = ActiveSupport::Logger.new($stdout) console.formatter = Rails.logger.formatter console.level = Rails.logger.level Rails.logger.extend(ActiveSupport::Logger.broadcast(console)) 来源: https://stackoverflow.com/questions/22158675/thin-server-ouput-rails-application-logs-to-console-as-rails-s-does

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

余生颓废 提交于 2019-11-29 20:43:02
问题 This question already has answers here : Closed 7 years ago . 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"] end end Rack::Handler::Thin.run HelloWorld.new, :Port => 9294 #I've tried with these added too, 'rack.multithread' => true, 'rack.multiprocess' => true Here's a test run: $ ab -n 20000 http://0.0.0.0:9294/sdf

How to get Rails 4 ActionController::Live streaming working with Thin and Ruby 2? And how do Thin and Puma scale with live streaming?

为君一笑 提交于 2019-11-29 14:33:58
问题 I get it working with Puma, but with Thin I don't get any stream output and I have to kill the server to stop it. I'm testing using tenderlove's initial example outputing the current time: http://tenderlovemaking.com/2012/07/30/is-it-live.html A more general question to me is, is this type of streaming practical in an app with any significant traffic? I imagine there can be easily hunderts if not thousands of users connected to a stream at once in such app. How would Puma scale here? I read

Can I enable SSL in Sinatra with Thin?

萝らか妹 提交于 2019-11-29 14:24:30
问题 I'm looking for a simple way to enable SSL in a standalone Sinatra application running via Thin without having to pass the --ssl , --ssl-key-file and --ssl-cert-file parameters in via the Thin command line. Is it possible to define them directly within the Sinatra app or via a config.ru file? I've spent several hours looking for an answer to this question, but so far have not found anything that works. 回答1: I just spent a few hours trying to figure this one out myself. It turns out that Thin:

Thin with SSL support and ruby-debug

♀尐吖头ヾ 提交于 2019-11-29 04:23:41
Does anyone know of a way to run the ruby debugger and SSL at the same time with Thin? I've been using Thin successfully with Rails 3.0.10. I start it using rails server --debugger , and I can debug my code. Recently, I have also needed to add SSL support to my application, and I'd like to be able to test it locally with a self-signed certificate. Unfortunately, I have not found a way to start Thin with SSL support when using rails server . I can successfully start Thin with SSL support by using: thin start --ssl --ssl-verify --ssl-key-file ssllocal/server.key --ssl-cert-file ssllocal/server

Is there a way Rails 3.0.x can default to using Thin?

谁说我不能喝 提交于 2019-11-28 21:30:13
I run the Thin webserver for basically every app in my dev/test environments. When I used Mongrel with Rails 2.x, all I had to type was script/server to get it to run the webserver I choose. But with Rails 3, I have to specify Thin every time. Is there a way to get Thin running on my Rails apps by just typing rails s instead of rails s thin ? As of Rails 3.2rc2, thin is now run by default on invoking rails server when gem 'thin' is in your Gemfile! Thanks to this pull request: https://github.com/rack/rack/commit/b487f02b13f42c5933aa42193ed4e1c0b90382d7 Works great for me. Yeah it's possible to

Enable https in a rails app on a thin server

杀马特。学长 韩版系。学妹 提交于 2019-11-28 20:38:53
I have a rails app running a thin server on heroku. It currently uses http. I would like to use https for bot development and production. Where do I begin to do this. I have looked at this railscast where they show how to use a POW server. I dont want to use a POW server, I want to use a Thin server. I also looked here : But here they assume that you have open ssl insatlled. I haven't found any place which shows how to run https on a thin server from scratch. I was wondering if anyone has any suggestions. Thanks Try this: $ thin start --ssl You will need a separate instance if you want both

How to preserve request url with nginx proxy_pass

社会主义新天地 提交于 2019-11-28 15:30:50
I was trying to use Thin app server and had one issue. When nginx proxies the request to Thin (or Unicorn) using proxy_pass http://my_app_upstream; the application receives the modified URL sent by nginx ( http://my_app_upstream ). What I want is to pass the original URL and the original request from client with no modification as the app relies heavily on it. The nginx' doc says: If it is necessary to transmit URI in the unprocessed form then directive proxy_pass should be used without URI part. But I don't understand how exactly to configure that as the related sample is actually using URI: