JMeter takes long time to download resource - download

I am testing a static pages of website. I am talking only about homepage here. This home page takes around 20 seconds for full download and in around 6 sec you would see the page ( so user perspective is good)
now that page has eleven mp4 files, and in JMeter they take long time to download, why is that? In Google developer tool that page shows download completed in around 20 sec but my JMeter recorded script reports 60 sec for downloading all resources.
I also used Parallel controller with 6 connection but with that too it reports around 1 min of response time for the whole page. ..and once again, it takes around 20 min in Chrome to download all content.
If I use main(first) URL of homepage and check "Retrieve all embedded resources", then all resources would be downloaded but mp4 files are not downloaded. Why is that?
I also have all recorded requests of the homepage. And if I run those requests then all requests are fine but mp4 takes more time to download than they take in Chrome and response time goes to around 60 sec.
I tried my best to explain the scenario. Please Please help. Your help would be deeply appreciated.

Are you sure that these .mp4 files are being downloaded when the user opens the page?
If yes, are you sure that they're being downloaded fully, for example most common scenario is that the server sends Content-Range header telling the browser which part of the .mp4 file(s) to fetch
If no - you shouldn't be downloading them in your JMeter test at all. Compare the traffic from the real browser and from JMeter using a 3rd-party sniffer tool like Wireshark or Fiddler and make sure that JMeter sends the same request as browser does
Try opening the page in browser with clear cache. It might be the case that the browser has cached the heavy content hence no actual requests are being made and multimedia resources are being returned from memory or disk cache. If this way you will see similar timings - add HTTP Cache Manager to your test plan

Related

Long TTFB in File Upload request only at Chrome

I have an upload field in a form that uploads the file via ajax, and "attaches" it to the form to send it along.
What is happening is that the request to upload the file is taking a crazy long time in Chrome to complete. It works normally on my browser (Opera).
The Server/Environment Specs:
Apache server
Linux OS
Using Cloudflare
If you need any other information, just ask!
Analysing the XHRs, you can see the huge difference, just to be clear: this was the upload of the same file, same network, same computer, just different browsers. You see the sending time is almost the same, but the Wait Time (or TTFB) is very different.
Opera:
Chrome:
Is there any reason for this? I read something about Chrome having threading limits, but doesn't seem to be the reason for this.

Why might a resource request be slow only when requested by a page?

I have a webpage that pulls in a ~500kb JPG that takes around 11s in the Content Download phase (in the Chrome Network tab).
What is strange is that if I access that same resource on a tab of its own or via curl, it downloads in less than a second.
I've even made sure that I'm including all the headers and cookies that the page uses.
Are there any mechanisms that limit throughput for page requests that would manifest in this way? Any suggestions about what could result in this behaviour?

Load time of a page in Jmeter

I understand that the primary use of Jmeter is not finding the load time of a page. However, I'd like to know if there's any tool for the below scenario to calculate the approximate load time of a page (barring the rendering time):
Calculate the response time of various web requests for a particular page P1 using JMeter
Record and save the web request pattern of the page P1 in the desired browser
A tool replaces every web request in the pattern with the response time recorded in Step 1 and based on the timeline slice in Step 2, gives us the load time of the given page P1
Hope I'm making sense
Actually the answer lives at JMeter Home Page
JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time)
You don't need to do anything as JMeter doesn't actually render page. You may want to perform some tweaks to make it behave more like a real browser, especially HTTP Cache Manager matters.
In regards to saving browser traffic - for Chromium and derivatives you can do it right from Developer Tools by right-clicking a request in Network tab

How to speeden up SWF load time?

I'm optimizing a Flash website in order to load as quickly as possible, and in certain edge cases the SWF takes upto 10 seconds to load. There are no external assets except for the SWF file, and the only JS is embedded into the HTML page.
As this trace shows, the SWF request is sent by the browser only after the DOMContentLoaded event fires, which takes 8 secs. In most cases the SWF starts loading in about 2 seconds.
Is there a way to quicken the request latency? Currently the SWF is inserted with Javascript, using the SWFObject library, so only after the browser renders the HTML page does the JS execute and add the SWF tag into the webpage. What if I added the same SWF tag into the <head> section. Would this somehow preload the SWF causing the JS to get the SWF immediately when it executes later in the <body>?
Usually the rule of thumb in load-time optimization is to use as few requests (files) as possible. But the SWF file must be seperated from the HTML file. Or is there a way to embed it as base64 into the HTML, and have JS convert this into a file and load it as a Flash <object> tag instantly? I'm willing to try any tricks as long is its compatible/reliable with all browsers.
Specs:
Internet : I have an 5 MBit/sec internet connection, and I can ping the server in 280 ms.
Location : The webserver is in the US, and I'm currently in Mumbai, India.
Filesizes : 20 KB for the SWF, 5 KB for the HTML.
I blame the server, i gather its a shared hosting server...resources could be limited, even though you ping the server quickly the server then must navigate to where your website is on there hard disks..also other factors of bandwidth matter too...take into account not only your server provider but your provider, and other general congestion in between you and the US.Try a closer server...
I had this problem as i am based in Australia and i too had a US server...good at times but more or less unreliable, so i got a premium server in Australia in my main capital city(works perfect). Alot of web hosting providers offer free trials to test there speeds.
See if this is an issue...
might be a hassle but could help with your problem.
TEST:
in the run enter (CMD)
then type "ping yourwebsite.com"
results for my website are 20ms / www.parele.com.au (sydney based server Australia)

Logging local page load times in browser

I am trying to generate a log of page load times (time from first byte of HTML to the onload event) from my actual browsing habits. An ideal solution would produce, after performing a google search for example, a log something like this:
http://google.com/ 523
https://www.google.com/search?q=asdf 1003
Where the pages took 523ms and 1003 to load.
A firefox or chrome extension that works on linux or mac would be ideal, as I'm trying to track in the context of normal everyday browsing.
If you install the NetExport Firebug extension, it will allow you to export all collected and computed data from the Firebug Net panel as a HTTP Archive (HAR) format file (based on JSON).
You can then view this file that includes load times using HAR Viewer or other tools.
Gavin,
Try using the FireBug Plugin in FireFox. http://getfirebug.com/
It shows you when the file started and stopped loading relative to all the other files.
Worth checking out.
Regards,
Ninad
You need Fiddler. http://www.fiddlertool.com
Another great tool which does what you requested in the comments is dynatrace ajax. http://ajax.dynatrace.com/ajax/en/ It hooks into the browser and keeps metrics on actual render and js times. http://ejohn.org/blog/deep-tracing-of-internet-explorer/

Resources