rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: rack-devel@googlegroups.com
Cc: Aman Gupta <aman@tmm1.net>
Subject: Re: [RFC/PATCH] Add Rack::Builder#warmup method for app preloading.
Date: Wed, 6 Nov 2013 02:57:52 +0000	[thread overview]
Message-ID: <20131106025752.GA1712@dcvr.yhbt.net> (raw)
In-Reply-To: <20131029175419.GA14881@dcvr.yhbt.net>

Eric Wong <normalperson@yhbt.net> wrote:
> James Tucker <jftucker@gmail.com> wrote:
> > Yeah, Builder#call leads to mistakes all the time and then people claiming
> > performance sucks. I don't think the simple use case there ever helped.
> 
> Just curious, is this in test suites or code running on live servers?
> I can't imagine there are many one-off webservers existing and using
> that directly...

Answering my own question, the "map" directive in Builder seems to
trigger Builder#to_app in every single request.

It looks like map completely defeats warmup and preloading...

-------------------------------8<-----------------------------
require 'rack/lobster'
class Wtf
  def initialize(app)
    # this prints every single request :<
    p "#$$ #{Time.now} initialized"
    @app = app
  end
  def call env
    @app.call(env)
  end
end

map "http://example.com/" do
  use Wtf
  run Rack::Lobster.new
end
-------------------------------8<-----------------------------
(tested with "rackup -s webrick", too, so none of my own broken server
 code running)

But yeah, extensive use of map on *.bogomips.org and *.yhbt.net
now that I've switched that hole thing over to yahns...

-- 

--- 
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

  reply	other threads:[~2013-11-06  2:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 23:10 ruby
2013-10-02 23:55 ` Konstantin Haase
2013-10-29  0:02   ` James Tucker
2013-10-29  0:21     ` Santiago Pastorino
2013-10-29 17:54     ` Eric Wong
2013-11-06  2:57       ` Eric Wong [this message]
2013-11-06  3:12         ` [PATCH] builder: avoid to_app on every request when using map Eric Wong
2014-07-15  4:09           ` James Tucker

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-list from there: mbox

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

  List information: https://groups.google.com/group/rack-devel

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

  git send-email \
    --in-reply-to=20131106025752.GA1712@dcvr.yhbt.net \
    --to=rack-devel@googlegroups.com \
    --cc=aman@tmm1.net \
    --subject='Re: [RFC/PATCH] Add Rack::Builder#warmup method for app preloading.' \
    /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:

	https://80x24.org/mirrors/rack.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).