API script outputs 2kb of data:
TTFB from ajax call is 1.65s on average
TTFB from GET request is 100ms
Is there a discussion to be had around AJAX vs GET requests when considering TTFB? I cannot find anything online to suggest what may cause this discrepancy.
Related
when doing AJAX calls with XQuery in exist-db I noticed some unusual discrepancies between waiting and receiving times. Usually these are far too small to notice, but recently I ran into a problem.
I need to pass a whole 5 MB response at once and I noticed that while evaluating the call in eXide it takes somewhere below 3 seconds, which is decent since it is a complex call. But when passing it via Ajax I noticed that it takes between 8 and 11 seconds in total, with almost equal waiting and receiving time. Now 5 MB is not really that much, so I was surprised it took so long to transfer it. So I ran the .xql script in an empty browser page, and saw the same issue, 4-5 seconds waiting times and just as much receiving time.
I tried changing the output method to raw text, json, etc but there seems to be no difference whatsoever. Am I missing something and do I need to configure eXist in a certain way to increase these speeds or should I get used that this is just how it's supposed to work for anything over 1 megabyte?
I am using Jmeter for performan testing, I believe elapsed time is the response time which I am considering(i.e.,85 milliseconds). When I hit the same request from postman It is taking very less time(i.e.,35 milliseconds) so I want to know where my JMETER giving correct results or not
Elapsed time consists of:
Connect time (it might include SSL handshake)
Latency
Application response time
Given you're running the same request (URL, body, headers) from the same machine you should have similar results.
Try running the request for more times, i.e. 10 or 100 using newman and JMeter (set number of iterations in Thread Group to 100). If you will still be seeing differences - consider comparing the requests using an external sniffer tool like Wireshark, it will give you more insights regarding what's going on under the hood.
What is the meaning of "response time" in Jmeter?
Is the average response time equivalent to Page load time, or is it something different?
As per The Load Reports guide
RESPONSE TIME is the amount of time the system takes to process a
request after it has received one. This parameter does not include
time that it needed to transmit HTTP/s requests over network to
web-server under test.
LATENCY is the delay involved for your request
to reach the server.
The response time that is required to receive a response from the
server is the sum of the response time + latency.
Response time is individual for each request and consists of server response time itself + time required for request to reach the server (latency)
Average response time is being calculated as arithmetical mean of all requests response times.
For instance, you have
Request 1 - 4s
Request 2 - 2s
Request 3 - 5s
So Average Time would be (4 + 3 + 5) / 3 == 4 seconds.
It depends.
How do you define page load time?
JMeter will tell you exactly how long it took to transfer over the network all of elements you want to include as part of a "page load". This can include:
Just the HTML page
The HTML page and all embedded resources on the HTML page (images, css, js)
The HTML page, all embedded resources and additional elements that are loaded after the initial HTML (such as elements that require Javascript / Ajax to load.)
What JMeter won't factor in is how long it took to execute any JS that ran on the page.
Enable "Retrieve All Embedded Resources" in the HTTP Request Sampler.
your Average Response time = Page Load Time
By Default "Retrieve All Embedded Resources" will be unchecked.
In order to measure the response time including the JS, CSS & Images (exactly as in the browser) this property should be checked before running the test.
Hope this will help.
I have this strange issue where sometimes if I make two AJAX requests to my Apache 2.2 server in rapid succession, the second request will wait for the first to finish before finishing.
Example, I have two requests, one that sleeps for 10 seconds and one that returns immediately. If I run the request that returns immediatly by itself it will always return within 300ms. However, if I call the request that takes 10 seconds, and then call the request that returns right away about 50% of the time the second request will wait until the first finishes and chrome will report that the request too about 10 seconds before receiving a response. The other half of the time the quick request will return right away.
I can't find any pattern to make it behave one way or another, it will just randomly block the quick AJAX requests sometimes, and other times it will behave as expected. I'm working on a dev server that only I am accessing and I've set several variables such as MaxRequestsPerChild to a high value.
Does anyone have any idea why Apache, seemingly at random, is turning my AJAX requests into synchronous requests?
Here is the code I'm running:
$.ajax({async:true,dataType:'json',url:'/progressTest',success:function(d){console.log('FINAL',d)}}); // Sleeps for 10 seconds
$.ajax({async:true,dataType:'json',url:'/progressTestStatus',success:function(d){console.log('STATUS',d)}}); // Takes ~300ms
And here are two screen shots. The first where it behaved as expected and the second where it waited for the slow process to finish first (in the example the timeout was set to 3 seconds).
UPDATE: Per the comments below - this appears to be related to Chrome only performing one request at a time. Any ideas why Chrome would set such a low limit on async requests?
The problem is not with Apache but with Google Chrome limiting the number of concurrent requests to your development server. I can only make guesses as to why it's limited to one request. Here are a couple:
1) Do you have many tabs open? There is a limit to the total number of concurrent connections and if you have many tabs making requests with KeepAlive you may be at that limit and can only establish one connect to your server. If that's the case you might be able to fix that by adding KeepAlive to your own output headers.
2) Do you have some extensions enabled. Some extensions do weird things to the browser. Try disabling all your extensions and making the same requests. If it works then enable them one at a time to find the culprit extension.
I'm working on developing a web site using cakephp. I'm analyzing the website now using firebug + Yslow and Google chrome developer tools. In an Ajax request I get a large waiting time about 6s while the receiving time is too small 66ms which cause a great latency in the request. Does anybody know why the waiting time is too large??
Waiting time - From the time of request to the time first byte is received, which involves a round trip time. There can be latency if your server away from your machine. Usually it requires 3 round trips. 1 for DNS lookup and 1 for establishing TCP Connection, 1 for request and response pair.
Receiving Time : It will be less if there is less amount of data being downloaded from the server to the client.
For further reference : http://www.webperformancematters.com/journal/2007/7/24/latency-bandwidth-and-response-times.html
My guess is that you might be performing a SQL query as part of the resource that you are calling via Ajax. If this is the case, you may need to tune your query or indexes to improve the speed of the query. Can you post some code so we may review?