I was making tests on my windows 2008 server with apache 2.2 and php 5.3 using Jmeter to test 300 hits on 10 seconds. I was suprised when nocited there was a huge delay with an extremely simple script
echo'
<script language="JavaScript" src="xx.js" type="text/javascript"></script>
<script language="JavaScript" ssrc="xx.js" type="text/javascript"></script>
<script language="JavaScript" src="xx.js" type="text/javascript"></script>
<script language="JavaScript" src="xx.js" type="text/javascript"></script>';
after that test, I changed the script tag for "script1" or anything else (even other valid tags such as link)
echo'<script1 language="JavaScript" src="xx.js" type="text/javascript"></script>
<script1 language="JavaScript" ssrc="xx.js" type="text/javascript"></script>
<script1 language="JavaScript" src="xx.js" type="text/javascript"></script>
<script1 language="JavaScript" src="xx.js" type="text/javascript"></script>';
and the script run quickly as supposed
here are the results from jMeter. and i still don't know what causes this or how to improve it
Case 1 using tags correctly, 300 samples avg 3218 ms samples per minute:1262
Case 2 using tags, 300 samples avg 116ms samples per minute:1783
EDIT: In my test in jmeter im only donwloading and requesting a single php and not the static files, there's no reason for Jmeter to try to parse/download the jsvascript failes, it is supposed to send the request and save the response and nothing else.
If that was the case jmeter would donwload all included files .ico, .css, images, etc and have an important delay, but only happens with script tag as if php or apache were making and extra process when they find that on a string. I tried double and single quotes and also heredoc to format the string containing the script tags but is the same.
Now I runned the tests on wamp with apache 2.4 AND PHP5.4 and the issue is solved, jmeter solves both scripts in the same time. So obviously it has to do with either php or apache, maybe a module or an extension that parses de buffer before echoing but still don't know which one is causing this