unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Tatsuya Ono <ononoma@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Why so many worker threads?
Date: Fri, 1 Mar 2013 20:54:26 +0000	[thread overview]
Message-ID: <CAHBuKRgP9r1whPuyGUP2zLmOSFv6ixdM3Bx3PLxY1tWmApAULA@mail.gmail.com> (raw)
In-Reply-To: <CAHF=L-xGZXMNs4CtnDBuA15xMYZMQSa0r9etCc4Ewf0UY9_+Dw@mail.gmail.com>

NewRelic and Airbrake are popular gems which spawns threads.

Unfortunately I don't think there is a silver bullet to detect which
gems are doing that. You have to investigate it step by step. For
example, you can create a new Rails app with the Gemfile(assuming you
use bundler), config and initializers. If you succeeded to reproduce
the problem with the small app, the rest of research would not be
difficult. You remove a gem one by one and restart app and you may
want to make some requests, then check the number of threads. If the
number of threads is reduced, that's would be it.

Or maybe you can grep your gem library directory with some keywords
like "Thread" or "Proc"? If you install gem library to specific path
(--path option on Bundler) for the application, you can avoid look at
other gems installed by other ruby application.
http://gembundler.com/v1.2/bundle_install.html


I don't think that the problem is related to Unicorn though.

Good luck :-)

On 1 March 2013 19:14, Alejandro Riera <ariera@gmail.com> wrote:
>
> >>> >   * screenshot: http://i.stack.imgur.com/U9TFR.png
> >>> >   * unicorn.rb: https://gist.github.com/907th/4995323
> >> which command do you run to show that list?
> >
> > Screenshot? Its `htop` command with tree (F5) view.
>
>
> I have just one worker. If I run top I just see one master and one
> worker. But with htop there are 3 masters and 3 workers, each of them
> with a different pid. This is a surprise to me too. I'm runnnig ruby
> 1.9.2.
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn@rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

  reply	other threads:[~2013-03-01 20:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 11:19 Why so many worker threads? Alexey Chernenkov
2013-03-01 17:41 ` Eric Wong
     [not found]   ` <CAHF=L-xHOguSLkyytYS6G-b=5nHYid-Mgz1MOqo8=zm0sRk=kQ@mail.gmail.com>
2013-03-01 19:05     ` Alexey Chernenkov
2013-03-01 19:14       ` Alejandro Riera
2013-03-01 20:54         ` Tatsuya Ono [this message]
2013-03-01 19:06   ` Alexey Chernenkov
2013-03-01 23:05     ` Eric Wong
2013-03-01 18:29 ` Alejandro Riera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHBuKRgP9r1whPuyGUP2zLmOSFv6ixdM3Bx3PLxY1tWmApAULA@mail.gmail.com \
    --to=ononoma@gmail.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).