latency

Why is request_time much larger than upstream_response_time in nginx access.log?

℡╲_俬逩灬. 提交于 2019-12-03 02:32:56
I am trying to improve the performance of a web app. Profiling the app itself, I found its response time are quite acceptable (100ms-200ms), but when I use ApacheBench to test the app, the response time sometimes exceeds 1 second. When I looked closely at the logs, I found a big discrepancy between request_time and upstream_response_time occasionally: "GET /wsq/p/12 HTTP/1.0" 200 114081 "-" "ApacheBench/2.3" 0.940 0.286 "GET /wsq/p/31 HTTP/1.0" 200 114081 "-" "ApacheBench/2.3" 0.200 0.086 The upstream_response_time is quite close to my profiling in the web app, but request_time is close to one

How can I find the response time (latency) of a client in NodeJS with sockets (socket.io)?

送分小仙女□ 提交于 2019-12-03 01:32:36
问题 I'm trying to create a multiplayer game with NodeJS and I want to synchronize the action between clients. What would be the best way to find the latency (the time that a request take to come back to the client) between the client and the server? My first idea was that the client #1 could send a timestamp with is request, so when client #2 will receive the action of the client #1 he will adjust is action speed to remove the delay of the request. But the problem is that maybe the system date

Ruby GC execution exceeding ~250-320ms per request

女生的网名这么多〃 提交于 2019-12-02 23:17:22
I have a ruby on rails application. I am investigating an Apdex decline in my NewRelic portal and I'm seeing that on average, 250-320ms of time is being spent on GC execution. This is a highly disturbing number. I've included a screen shot below. My Ruby version is: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] Any suggestions for tuning this would be ideal. This number should be substantially lower. You're spending so much time in GC because you're running your GC so often. Ruby, by default, sets GC parameters that are appropriate for small scripts, not large apps. Try launching

preconnect vs dns-prefetch resource hints

夙愿已清 提交于 2019-12-02 17:32:32
https://www.w3.org/TR/resource-hints/ If I understand correctly, both are used to initiate an early connection to load resources faster at a later time. preconnect is just doing "more". Apart from a better browser support, is there any reason to use dns-prefetch over preconnect? I've also seen websites using both rel at the same link tag in order to use preconnect if possible and fall back to dns-prefetch if not. <head> <link rel="dns-prefetch preconnect" href="https://fonts.gstatic.com" crossorigin > </head> I've been researching the topic a bit lately and so far my (theoretical) conclusions

Java BlockingQueue latency high on Linux

怎甘沉沦 提交于 2019-12-02 16:41:15
I am using BlockingQueue:s (trying both ArrayBlockingQueue and LinkedBlockingQueue) to pass objects between different threads in an application I’m currently working on. Performance and latency is relatively important in this application, so I was curious how much time it takes to pass objects between two threads using a BlockingQueue. In order to measure this, I wrote a simple program with two threads (one consumer and one producer), where I let the producer pass a timestamp (taken using System.nanoTime()) to the consumer, see code below. I recall reading somewhere on some forum that it took

How can I find the response time (latency) of a client in NodeJS with sockets (socket.io)?

跟風遠走 提交于 2019-12-02 15:16:33
I'm trying to create a multiplayer game with NodeJS and I want to synchronize the action between clients. What would be the best way to find the latency (the time that a request take to come back to the client) between the client and the server? My first idea was that the client #1 could send a timestamp with is request, so when client #2 will receive the action of the client #1 he will adjust is action speed to remove the delay of the request. But the problem is that maybe the system date time of the two clients are not identical so it is not possible two know the reel delay on the request of

Measure service latency with prometheus

ぃ、小莉子 提交于 2019-12-01 21:28:42
问题 I am new to prometheus and grafana... My primary goal is to get the response time per request. For me it seemed to be a simple thing - but whatever I do I do not get the results I require. I need to be able to analyse the service lateny in the last minutes/hours/days. The current implementation I found was a simple SUMMARY (without definition of quantiles) which is scraped every 15s. Is it possible to get the average request latency of the last minute from my prometheus SUMMARY? If YES: How?

How to Reduce Thread.sleep() Latency in Android

我与影子孤独终老i 提交于 2019-12-01 19:30:37
I am generating timing events in a loop in a (non-UI) thread in an Android application, and I need those events to occur at precise intervals in time, (precise here means not varying any more than +/- 5 millisecs). Any errors of +/-10 millisecs (and certainly +/- 20 millisecs) can be perceived by the user. At the top of this loop I do some other calculations that take a variable amount of time, but at the bottom of the loop, I need the event to occur at a pre-calculated time. A higly simplified version (without exception handling) of one attempt at my non-UI thread is below: public final void

Measure service latency with prometheus

廉价感情. 提交于 2019-12-01 18:22:59
I am new to prometheus and grafana... My primary goal is to get the response time per request. For me it seemed to be a simple thing - but whatever I do I do not get the results I require. I need to be able to analyse the service lateny in the last minutes/hours/days. The current implementation I found was a simple SUMMARY (without definition of quantiles) which is scraped every 15s. Is it possible to get the average request latency of the last minute from my prometheus SUMMARY? If YES: How? If NO: What should I do? Currently I am using the following query: rate(http_response_time_sum

jQuery/Javascript framework efficiency

隐身守侯 提交于 2019-12-01 13:20:31
My latest project is using a javascript framework (jQuery), along with some plugins (validation, jquery-ui, datepicker, facebox, ...) to help make a modern web application. I am now finding pages loading slower than I am used to. After some js profiling (thanks VS2010!), it seems a lot of the time is taken processing inside the framework. Now I understand the more complex the ui tools, the more processing needs to be done. The project is not yet at a large stage and I think would be average functions. At this stage I can see it is not going to scale well. I noticed things like the 'each'