Combating nginx 499 HTTP responses during flash traffic scenario

Eric Wong normalperson at
Thu Nov 29 21:30:17 UTC 2012

Lawrence Pit <lawrence.pit at> wrote:
> >[2]
> >I haven't heard back on results of our nasty/crazy solution, though.
> fyi: I've been running that patch for a while in our staging
> environment. As far as I can tell it works. Though we haven't tested
> it with older browsers such as IE6 (we do not have that requirement)
> nor with all of the API clients we see (java, python, etc., we do
> have that requirement).
> Hopefully we're bringing that patch into our production environment
> within the next couple of weeks, and then we should see results
> later that week.
> Tom Burns wrote:
> >Unexpectedly the patch also helped us ward off a DoS attack where the
> >attackers were disconnecting immediately after making a request.
> Awesome!
> The only thing that worries me is that Eric calls this a
> "nasty/crazy solution". :p Not sure why. Seems to me it's a rather
> smart solution that perhaps in the future would deserve to be the
> default.

Until now, it was unproven.  AFAIK, no other app server does
anything similar.

Maybe other servers/protocols have similar things, I'd love to know.

> A related question: is it possible to get insight in what's in the
> unicorn queue and for how long requests have been queued there?

On Linux, tcpi_last_data_recv in the structure returned by TCP_INFO
tells you when the last packet was received on the socket, so it's an
accurate indication of queue time.  Raindrops provides an interface for
accessing it:

I haven't heard much feedback about it, though.

Using SystemTap (or similar solutions), I think the same information may
be retrieved without modifying the Ruby process.  I'm just starting my
exploration of SystemTap, though...

Raindrops::Watcher is less accurate/informative, but can run without
modifying the process.  I've used this heavily, but haven't
found anything interesting since I don't get enough traffic.

More information about the mongrel-unicorn mailing list