I was wondering if we load test a website using threads, will it be same as if we test with virtual agents (as number of VA is equal to number of threads).
I am asking this because when i monitor the time taken by the website using threads in java code, the average response time of website is good but when tested with a similar kind of nGrinder script with same number of virtual agents, the TPS comes very low (sometimes due to large number of error the test fails). The java code can be like this (this is just a representation.) ------------------------------------------ List<Thread> threadList = new ArrayList<Thread>(); for( int i=0 ;i <100 ; i++ ) { threadList.add(new Thread() { public void run() { http://somewebsite.com } }); } Stopwatch watch =new StopWatch().start(); for( Thread thread : threadList ) { thread.start(); } Long elapsedTime = watch.stop().getElapsedTime(); System.out.println("Avg Response Time"+ elapsedTime/threadList.size()); |
Administrator
|
Your java code measure thread start time not thread completion time.
:-) You should execute .join() method to wait until the threads complete. |
Administrator
|
and this line..
System.out.println("Avg Response Time"+ elapsedTime/threadList.size()); is completely wrong. each thread is executed in the concurrently so dividing elaspedTime by thread size doesn't result average of thread job. You java code should add the the elapsed time in the run method of all threads into a single member variable and you should divide this by thread count. |
Thanks for the reply.
I will modify as you said, but will it be the same approach as nGrinder. |
Administrator
|
This post was updated on .
Well.. ngrinder is not naive as I said. :-) It's much complex.
Even if you fix the your java code as I said, you can simulate very limited way of how ngrinder puts loads. If you'd like to evaluate that ngrinder result is valid or not, You'd better to write test scripts using the other performance test tools like JMeter or LoadRunner. Then compare ngrinder result against those. |
Thanks for the reply,
yes you are right it will not be possible to do a proper load testing with simple treaded java code. Can you explain me the significance of TPS in the nGrinder Report with respect to the following example, Agent = 2 Virtual Agent = 280 Duration 30 min |
Administrator
|
Please refer http://grinder.sourceforge.net/faq.html#calculation -----Original Message----- If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/How-is-Ngrinder-different-tp844p851.html
To start a new topic under ngrinder-user-en, email [hidden email]
To unsubscribe from ngrinder-user-en, click here. NAML |
Thanks for the link, it was very much informative.
However i have one more doubt, that can we get the average response time with nGrinder, As from the link you shared, it appears very different with TPS. Actually i was under the impression that it we have a TPS of 25 for 280 VA then it represents that the number of Transactions in one second will be 25. Please correct me if wrong. |
Administrator
|
TPS is transaction per second.
so.. if one call over remote web server takes 3 seconds and the server can only handle 30 concurrent calls. TPS might be 10. Because 30 concurrent call will be finished after 3 seconds if I should say simply. Because the each call is well distributed within 3 seconds.. We can see average TPS every second. In your case, some calls are might be blocked by the server concurrent processing power. (e.g: tomcat thread pool). The criminal is your server not ngrinder. :-) |
Thanks for your reply.
so if, TPS = 25, then average response time = 1/25 = 40 milli second. Please let me know if my understanding is correct. |
Administrator
|
Your understanding is valid only when vuser is 1.
|
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
|
Administrator
|
If the vuser is more than 1, queuing theory is applied.
http://en.wikipedia.org/wiki/Queueing_theory Well.. I don't feel I should explain this to you in detail. (Because in the performance test field it's very very basic topic) I highly recommend you to read following free ebook very carefully to understand the background knowledge http://www.eurostarconferences.com/community/member/ebook-library/'performance-testing,-a-practical-guide-and-approach'-by-albert-witteveen . |
Free forum by Nabble | Edit this page |