unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: "Bráulio Bhavamitra" <braulio@eita.org.br>
Cc: Sarkis Varozian <svarozian@gmail.com>,
	unicorn-public <unicorn-public@bogomips.org>
Subject: Re: Request Queueing after deploy + USR2 restart
Date: Mon, 14 Sep 2015 02:14:25 +0000	[thread overview]
Message-ID: <20150914021425.GA1720@dcvr.yhbt.net> (raw)
In-Reply-To: <CAJri6_sB05+C5j=+biXzTeGVoRDv_aA8iOJxxxMc5EkVbTg35Q@mail.gmail.com>

Bráulio Bhavamitra <braulio@eita.org.br> wrote:
> Sakis, ressurecting this.
> 
> I'm seeing this after the upgrade from rails 3.2 to rails 4.2. Maybe it is
> because of adequate record and other "cached on first time used" stuff.

I'm not knowledgeable enough to comment on Rails , but
"cache on first time used" includes the caches in the YARV RubyVM
itself:

1) inline method cache
2) inline constant cache
3) global method cache

The only way to warm up the inline caches is to actually run your
code paths (perhaps in warmup code).  After warmup, you need to
avoid defining new classes/constants or doing includes/extends/etc
because those things invalidate caches.

ruby-core has been working to reduce the size of internal data
structures in C to improve CPU cache utilization (which might make
the explicit RubyVM-level caches less necessary for small apps).

Ruby 2.3 should include some more speedups in method lookup;
but having the smallest possible code base always helps.

Regardless of language or VM implementation; big code and data
structures invalidates caches on the CPU faster than smaller
code and data structures.

So reduce your application code size, kill unnecessary features,
use a smaller framework (perhaps Sinatra, or even just Rack),
load fewer libraries, etc.


And yes, this mindset to making things smaller extends to mail:
stop bloating them with top-posts and insanely long signatures.

      reply	other threads:[~2015-09-14  2:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 22:24 Sarkis Varozian
2015-03-03 22:32 ` Michael Fischer
2015-03-04 19:48   ` Sarkis Varozian
2015-03-04 19:51     ` Michael Fischer
2015-03-04 19:58       ` Sarkis Varozian
2015-03-04 20:17         ` Michael Fischer
2015-03-04 20:24           ` Sarkis Varozian
2015-03-04 20:27             ` Michael Fischer
2015-03-04 20:35             ` Eric Wong
2015-03-04 20:40               ` Sarkis Varozian
2015-03-05 17:07                 ` Sarkis Varozian
2015-03-05 17:13                   ` Bráulio Bhavamitra
2015-03-05 17:28                     ` Sarkis Varozian
2015-03-05 17:31                       ` Bráulio Bhavamitra
2015-03-05 17:32                       ` Bráulio Bhavamitra
2015-03-05 21:12                       ` Eric Wong
2015-03-03 22:47 ` Bráulio Bhavamitra
2015-03-04 19:50   ` Sarkis Varozian
     [not found] ` <CAJri6_vidE15Xor4THzQB3uxyqPdApxHoyWp47NAG8m8TQuw0Q@mail.gmail.com>
2015-09-13 15:12   ` Bráulio Bhavamitra
2015-09-14  2:14     ` Eric Wong [this message]

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=20150914021425.GA1720@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=braulio@eita.org.br \
    --cc=svarozian@gmail.com \
    --cc=unicorn-public@bogomips.org \
    --subject='Re: Request Queueing after deploy + USR2 restart' \
    /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

Code repositories for project(s) associated with this inbox:

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