How is Ngrinder different

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

How is Ngrinder different

mathursharp
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());
               
               
               
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

junoyoon
Administrator
Your java code measure thread start time not thread completion time.
:-)

You should execute .join() method to wait until the threads complete.
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

junoyoon
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.
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

mathursharp
Thanks for the reply.

I will modify as you said, but will it be the same approach as nGrinder.
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

junoyoon
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.
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

mathursharp
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




Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

junoyoon
Administrator

Please refer http://grinder.sourceforge.net/faq.html#calculation

 

-----Original Message-----
From: "mathursharp [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2013-08-28 (수) 18:03:35
Subject: Re: How is Ngrinder different

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







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
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

mathursharp
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.
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

junoyoon
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. :-)
Reply | Threaded
Open this post in threaded view
|

Re: How is Ngrinder different

mathursharp
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.
Reply | Threaded
Open this post in threaded view
|

RE: Re: How is Ngrinder different

junoyoon
Administrator
Your understanding is valid only when vuser is 1. 


Reply | Threaded
Open this post in threaded view
|

RE: Re: How is Ngrinder different

mathursharp
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

RE: Re: How is Ngrinder different

junoyoon
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
.