Request latency information?

24 views
Skip to first unread message

Frédéric Bastien

unread,
Nov 14, 2012, 4:27:23 PM11/14/12
to pylons-...@googlegroups.com
Hi,

I'm building an app with pyramid. I have the server in pyramid, but I also a client in an applet.

In the case where the pyramid app is overloaded, I want to tell the client to slow down its connection speed to the server.

The best why is to know the latency of each requests. Can I access such information from pyramid? Knowing the latency is ideal I think as this would take into account the of the full system that include nginx above pyramid.

If that is not possible, I could use the number of incoming connection per seconds as I know how many it can handle. I would just lower it to take into account the rest of the server. I could count them myself, into each pyramid thread, but is that information already available somewhere?

thanks

Frédéric Bastien

Andi Balke

unread,
Nov 14, 2012, 5:16:49 PM11/14/12
to pylons-...@googlegroups.com
just opinions and thougts:

i would use nginx for that

on a first look it doesn't looks like ``upstream_response_time`` is available in uwsgi mode. 
but in worst case you could request your upstreams via http to get that information.

to integrate the response time to the client (as you said there is an applet) check: 
you could add a response header with simple nginx config, that transports that information (seems like the easiest cause there is no body parsing). 

cause it seems a bit weird to rely on the client to take responsibility for an overload. 
^^ this seems like the best option anyway.

cheers, andi

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.

Frédéric Bastien

unread,
Nov 16, 2012, 10:08:35 AM11/16/12
to pylons-...@googlegroups.com
Hi,

thanks for the information. If I'm able to make it work, I'll tell you.

About the nginx automatic failover, thanks, I didn't know, it will help. I was knowing how to use upstream to use multiple server, but I didn't know how to make it handle crashed process.

My goal is to be able to get slashdotted. One multi-core computer won't be enough if that happen even with multiple process to handle the static(nginx) and dynamic(pyramid) server (I have a computer with 2 CPU 4 cores Xeon5620). I wanted the server to tell the client the speed at witch it can contact him. I didn't taught of setting this logic inside the client: make the client time how long it took to contact the server. It is not the best solution I think, but if I'm not able to make my first idea work, it is a good fall back I think. The client have logic to do exponential back-off connection to the server if it fail to contact him, but I don't like relying on this to be able to scale to more client!

thanks

Frédéric
Reply all
Reply to author
Forward
0 new messages