Ruby Proxies for Scale and Monitoring - igvita.com
Including transparent sending of production traffic to staging.
Maybe for Omniture testing?
Lift the curtain behind any modern web application and you will find at least a few proxy servers orchestrating the show. Caching proxies such as Varnish and Squid help us take the load of our application servers; reverse proxies such as Haproxy and Nginx help us partition and distribute the workload to multiple workers, all without revealing the underlying architecture to the user. In the Ruby world, Rack middleware and Rails Metal are sister concepts: both allow the programmer to inject functionality in the pre or post-processing step of the HTTP request.
Three clusters Production (Huge!!) Staging (one) Benchmarking (same as staging)Ruby & WebSockets: TCP for the Browser - igvita.com
なにこれおもしろそう6 Line EventMachine Bugfix = 2x faster GC, +1300% requests/sec at time to bleed by Joe Damato
"This results in an increase from 500 requests/sec to 7000 requests/sec when using Sinatra+Thin+Epoll+Threads. That is pretty ill." -- Joe Damato
On top of all that, this patch helps with Ruby’s green threads, too. If the epoll_wait causes a Ruby event to fire and that event creates a Ruby thread, that Ruby thread gets an entire copy of the existing stack. Each time that thread is switched into and out of, that thread stack has to be memcpy’d into and out of place. Reducing those memcpys by ~800,000 bytes is a HUGE performance win. Want to learn more about threading implementations? Check out my threading models post: here. Fixing this turned out to be pretty simple. A six (6!!) line patch: * Speeds up GC by 2-3x because of the huge decrease in stack frame size. * Fixes an open bug in EventMachine where using threads with Epoll causes lots of slowness. The reason is that each thread will inherit an ~800,000 byte stack that gets copied in and out every context switch. * This results in an increase from 500 requests/sec to 7000 requests/sec when using Sinatra+Thin+Epoll+Threads. That is pretty ill.
l in all, a productive debugging session lasting about an hour. The result was a simple patch, with 2 big performance improvements.