Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: ghazel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: "Rainbows! list" <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: rails 2 and slow external services
Date: Mon, 13 Dec 2010 22:14:53 -0800	[thread overview]
Message-ID: <AANLkTi=FN02-OJc3Utzh74zMA+MX4KqHc6hUHjR5a=a_@mail.gmail.com> (raw)
In-Reply-To: <20101214045720.GC5051-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>

On Mon, Dec 13, 2010 at 8:57 PM, Eric Wong <normalperson@yhbt.net> wrote:
> ghazel@gmail.com wrote:
>> > ghazel@gmail.com wrote:
>> >> Some of my page loads (currently serviced by Unicorn) spend a great
>> >> deal of time waiting for external services (OpenID, OAuth, etc over
>> >> Net::HTTP and curb), so I'm looking at Rainbows!. I use Rails 2.3.10.
>>
>> This is Ruby 1.8.7 (REE). Is there any interesting difference between
>> ThreadPool and ThreadSpawn in this environment?
>
> ThreadPool is generally more predictable, but ThreadSpawn has lower
> memory usage if your traffic spikes are intermittent or low.
>
> ThreadSpawn is much like the original Mongrel and ThreadPool was an
> experiment with Ruby 1.9 in mind.  1.9 has more expensive (but slightly
> more concurrent) threading.  If your bottlenecks are external HTTP
> requests on 1.8, but first instinct would be to use ThreadSpawn.
>
> Ruby 1.9 + ThreadPool would probably be well-suited for large file
> serving to LAN clients with many slowish disks as it can use sendfile
> via IO.copy_stream), but if you can afford the constant memory overhead,
> it could be good in 1.8, too.

I don't mind constant memory overhead -  actually I prefer it to
spikey memory usage with an unknown peak. Otherwise they should be the
same?

>> I also make use of a (heavily modified, which is another topic) OobGC.
>> Does anyone know if garbage collection in ruby 1.8.7 is reasonably
>> threadable? I expect not, but one can hope.
>
> It is not, the entire interpreter stops running every single thread for
> GC.  I don't think using OobGC with any of the Rainbows! concurrency
> models will work, only :Base and Unicorn.

Well, not too surprising, but thanks for specifying.

I'm running a bit of my traffic through some Rainbows! right now, but I got:

2010/12/14 02:30:24 [error] 3183#0: *9229917 upstream timed out (110:
Connection timed out) while reading response header from upstream,
client: 1.2.3.4, server: mysite.com, request: "GET /blah HTTP/1.1",
upstream: "http://unix:/tmp/rainbows.sock:/blah", host: "mysite.com",
referrer: "https://foofoo.com"
2010/12/14 04:28:25 [error] 3182#0: *9440717 upstream timed out (110:
Connection timed out) while reading response header from upstream,
client: 5.6.7.8, server: mysite.com, request: "GET /blah HTTP/1.1",
upstream: "http://unix:/tmp/rainbows.sock:/blah", host: "mysite.com"

From nginx in the error log. My proxy_read_timeout is 300, and my
listen backlog is 2048 (for now...). Basically my Rainbows! config is
identical to my Unicorn config, where I have not seen that happen,
except I added "Rainbows! { use :ThreadPool; worker_connections 100
}".

Any ideas?

-Greg
_______________________________________________
Rainbows! mailing list - rainbows-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying

  parent reply	other threads:[~2010-12-14  6:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  0:14 ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <AANLkTikYESRSJbG3TViBPcsj7PDwcQ4O__xdtidvn_z1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-13 10:39   ` Eric Wong
     [not found]     ` <20101213103936.GA8440-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-13 20:40       ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]         ` <AANLkTikD5qSSxb_qtdMXF4pznu3EPxG7+6nVJLRkjttH-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14  4:57           ` Eric Wong
     [not found]             ` <20101214045720.GC5051-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-14  6:14               ` ghazel-Re5JQEeQqe8AvxtiuMwx3w [this message]
     [not found]                 ` <AANLkTi=FN02-OJc3Utzh74zMA+MX4KqHc6hUHjR5a=a_-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14  6:35                   ` Eric Wong
     [not found]                     ` <20101214063552.GA12020-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-14  7:13                       ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                         ` <AANLkTik+HpLvQTrNtLFRZ4xYtN4i_F8JVsBTT8odi4tm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14  7:49                           ` Eric Wong
     [not found]                             ` <20101214074944.GA13496-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-14  8:03                               ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                 ` <AANLkTiks_hBMMTHMEDmaxnya=pogx67AzK4Dzz+Kfbmz-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 17:27                                   ` Eric Wong
     [not found]                                     ` <20101214172748.GA18131-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-15  2:01                                       ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                         ` <AANLkTikegPX2-6Q93++bz_aLt+9nLPJXjg+NkL8tDjeE-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-15  2:40                                           ` Eric Wong
     [not found]                                             ` <20101215024043.GA10349-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-15  4:30                                               ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
2010-12-15 22:28                                           ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                                             ` <AANLkTimyy5XyVFF4+MWWgxfb63fCoAmWRYM=MEjVWn96-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-20  2:52                                               ` Eric Wong
     [not found]                                                 ` <20101220025256.GB20300-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-12-20  3:04                                                   ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
2010-12-16 14:39                       ` ghazel-Re5JQEeQqe8AvxtiuMwx3w
     [not found]                         ` <AANLkTi=7OhyTwkHsp_rXU7Gp1PokihiQ9bJigpO-BfN6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-20  1:00                           ` Eric Wong

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/rainbows/

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

  git send-email \
    --in-reply-to='AANLkTi=FN02-OJc3Utzh74zMA+MX4KqHc6hUHjR5a=a_@mail.gmail.com' \
    --to=ghazel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.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 inbox:

	../../rainbows.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).