Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Thin often takes 30 seconds to stop. I'm out of ideas...
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Spence  
View profile  
 More options Jun 4 2012, 6:33 pm
From: Tim Spence <yogi.wan.ken...@gmail.com>
Date: Mon, 4 Jun 2012 15:33:54 -0700 (PDT)
Local: Mon, Jun 4 2012 6:33 pm
Subject: Re: Thin often takes 30 seconds to stop. I'm out of ideas...
Thank you, Nick.  I found in lib/thin/runner.rb:

opts.on(      "--all [DIR]", "Send command to each config files in
DIR")      { |dir| @options[:all] = dir } if Thin.linux?

Even though this seems to work, I will probably change the incantation
to /path/to/thin stop -C path/to/config.yml .  I will let you know if
this helps thin stop more quickly.
Thanks,
Tim

On May 31, 6:15 pm, Nick Roosevelt <nro...@gmail.com> wrote:

> What's --all?  I am on 1.3.1, and "--all" isn't in the help text.  I have
> only had success with stopping with a specific config file and -C
> <config_file>, and that way, it works well.  Every other way I tried of
> stopping thin has resulted in the thin stopping immediately, but the
> command not returning immediately, or the thin not stopping.

> On Thu, May 31, 2012 at 4:48 PM, Tim Spence <yogi.wan.ken...@gmail.com>wrote:

> > Hello,

> > We have around 100 instances of our rails app running across six
> > machines, using a customized nginx as a load balancer.  Each machine
> > uses Thin 1.2.11 to host the app.  Thin works beautifully.

> > When we push new code, we start and stop thin with an /etc/init.d
> > script that in turn stops thin by executing "/path/to/thin stop --all
> > $CONFIG_PATH".

> > The trouble is that when we stop Thin, it takes up to 30 seconds
> > (config timeout limit) to stop the process.  This happens consistently
> > across machines.  Our average request completion time in Rails is
> > 150ms, with 90% of requests finishing in < 400ms, so I doubt that we
> > are unfortunate enough to be handling a long-running request on each
> > machine every time we stop Thin.  Consider that we push code with the
> > website down--nginx stops sending requests to our app servers several
> > seconds before we issue the stop command to Thin.

> > I know the machines are not overloaded, as we have plenty of RAM, swap
> > is minimal, and CPU load maxes out at ~ 0.5 per core.

> > I inherited this setup, so I don't know if we're even using Thin in
> > the best way.  Should we be using Thin Cluster instead?  Should that
> > even make a difference?  Are there configuration options--besides
> > lowering timeout and possibly killing requests--to shorten this time?

> > Here's our config:
> > ---
> > chdir: /var/www/rails/app_name/current
> > environment: production
> > address: 0.0.0.0
> > port: 9000
> > timeout: 30
> > log: log/thin.log
> > pid: tmp/pids/thin.pid
> > max_conns: 2048
> > max_persistent_conns: 1024
> > require: []

> > wait: 30
> > servers: 16
> > daemonize: true

> > --
> > You received this message because you are subscribed to the Google Groups
> > "thin-ruby" group.
> > To post to this group, send email to thin-ruby@googlegroups.com.
> > To unsubscribe from this group, send email to
> > thin-ruby+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/thin-ruby?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.