Sarkis Varozian <[email protected]> wrote:
> Braulio,
>
> Are you referring to the vertical grey line? That is the deployment event.
> The part that spikes in the first graph is request queue which is a bit
> different on newrelic:
> http://blog.newrelic.com/2013/01/22/understanding-new-relic-queuing/
I'm not about to open images/graphs, but managed to read that.
Now I'm still unsure if they are actually using raindrops or not to
measure your stats, but at least they mention it in that post.
Setting the timestamp header in nginx is a good idea, but you need to be
completely certain clocks are synchronized between machines for accuracy
(no using monotonic clock between multiple hosts, either, must be
real-time).
Have you tried using raindrops standalone to confirm queueing in the
kernel?
raindrops inspects the listen queue in the kernel directly, so it's
as accurate as possible as far as the local machine is concerned.
(it will not measure internal network latency).
I recommend checking raindrops (or inspecting /proc/net/{unix,tcp} or
running "ss -lx" / "ss -lt" to check listen queues).
You can also simulate TCP socket queueing in a standalone Ruby
script by doing something like:
-----------------------------8<---------------------------
require 'socket'
host = '127.0.0.1'
port = 1234
re = Regexp.escape("#{host}:#{port}")
check = lambda do |desc|
puts desc
# use "ss -lx" instead for UNIXServer/UNIXSocket
puts `ss -lt`.split(/\n/).grep(/LISTEN\s.*\b#{re}\b/io)
puts
end
puts "Creating new server"
s = TCPServer.new(host, port)
check.call "2nd column should initially be zero:"
puts "Queueing up one client:"
c1 = TCPSocket.new(host, port)
check.call "2nd column should be one, since accept is not yet called:"
puts "Accepting one client to clear the queue"
a1 = s.accept
check.call "2nd column should be back to zero after calling accept:"
puts "Queueing up two clients:"
c2 = TCPSocket.new(host, port)
c3 = TCPSocket.new(host, port)
check.call "2nd column should show two queued clients"
a2 = s.accept
check.call "2nd column should be down to one after calling accept:"
-----------------------------8<---------------------------
Disclaimer: I'm a Free Software extremist and would not touch
New Relic with a ten-foot pole...
> We are using HAProxy to load balance (round robin) to 4 physical hosts
> running unicorn with 6 workers.
I assume there's nginx somewhere? Where is it?
If not, you're not protected from slow uploads with giant request
bodies. I'm not up-to-date about current haproxy versions, but AFAIK
only nginx buffers request bodies in full.
With nginx, I'm not sure what the point of haproxy is if you're just
going to do round-robin; nginx already does round-robin. I'd only
use haproxy for a "smarter" load balancing scheme.