Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: mongrel-unicorn@rubyforge.org
Cc: rainbows-talk@rubyforge.org
Subject: why Unicorn doesn't do slow clients
Date: Wed, 7 Oct 2009 17:09:42 -0700	[thread overview]
Message-ID: <20091008000942.GA25054@dcvr.yhbt.net> (raw)

You may have heard of Slowloris and Nkiller2 (if not check them out),
but there is also david:

  http://git.bogomips.org/cgit/david.git

I wasn't comfortable with announcing this two years ago when I wrote it.
I'm OK now since Slowloris and Nkiller2 are similar (ok, Nkiller2 is
lower-level and meaner) and attacks of this type should be well-known by
now.  I'm sure some folks have known about these types of attack since
the 1990s, even.

I haven't touched david in over two years and don't have any desire to
maintain or support it.  Feel free to take and hack on it for your own
testing or even make it into a real project, but please be nice and
don't hurt people with it.

This is different from Slowloris in that it throttles the entire request
including the POST/PUT body.  Most proxies (including haproxy) don't
buffer bodies before sending them on whereas nginx will buffer large
ones to temporary files.


I originally wrote david to convince some friends to stick nginx in
front of anything that wasn't nginx; including Apache +
mod_perl|mod_php|mongrel and Tomcat setups.

And it was quite convincing at the time :>


Implementation details:

  * david combines fork() with select() to multiplex file descriptors
    and get around select() and non-priviledged process FD limits.

  * The defaults at the top of the davic.c file are all pretty tame,
    but they're all commented on and you can tweak them.

  * david mmaps a raw file that is an HTTP request, some small
    samples are provided but you can/should generate your own large
    POST/PUT requests to really stress request body handling.

-- 
Eric Wong

                 reply	other threads:[~2009-10-08  0:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20091008000942.GA25054@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    --cc=rainbows-talk@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/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).