You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2018/05/20 21:25:37 UTC

[Bug 62390] New: jmeter threads use overloaded run method but not CachedThreadPool

https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

            Bug ID: 62390
           Summary: jmeter threads use overloaded run method but not
                    CachedThreadPool
           Product: JMeter
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: srijondas@gmail.com
  Target Milestone: ---

jmeter threads use overloaded run method to implement multithreading. This
makes it impossible to pause/restart the threads. Implementing threads by using
CachedThreadPool will make it possible to pause/restart the threads.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #1 from Srijon <sr...@gmail.com> ---
/* This is the original way multithreading was implemented in jMeter by
implementing the Runnable interface

    public void runTest() throws JMeterEngineException {
        if (host != null){
            long now=System.currentTimeMillis();
            System.out.println("Starting the test on host " + host + " @ "+new
Date(now)+" ("+now+")"); // NOSONAR Intentional
        }
        try {
            Thread runningThread = new Thread(this, "StandardJMeterEngine");
            runningThread.start();
        } catch (Exception err) {
            stopTest();
            throw new JMeterEngineException(err);
        }
    }

  */

  /*This is the proposed way to implentation using executors, this will allow
jmeter threads to be paused during execution*/

      @Override
    public void runTest() throws JMeterEngineException {
        if (host != null){
            long now=System.currentTimeMillis();
            System.out.println("Starting the test on host " + host + " @ "+new
Date(now)+" ("+now+")"); // NOSONAR Intentional
        }

        ExecutorService execService = Executors.newCachedThreadPool(); //using
newCachedThreadPool to implement multi-threading in jMeter
        execService.execute(this);

    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #6 from Felix Schumacher <fe...@internetallee.de> ---
JMeter depends on the current threading model in a lot of places. It basically
treats one thread as one user and has done this for a long time. Plugins might
depend on this feature by using ThreadLocals (JMeter internally does this in a
few places).

So this is not an easy task.

If you want to pause threads you could implement this by using a PreProcessor
with some sort of pausing functionality based upon the thread id or the current
running threads.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #3 from Srijon <sr...@gmail.com> ---
In the commercial tools that I have used, after starting a test with 100
threads(virtual users), if I see too much load on the server then I am able to
pause 50 threads. On pausing the threads, the threads stop generating load.
Then once I feel that the server is performing better I can restart the 50
paused threads.

This gives a lot of flexibility to the performance test engineer, to tune the
load when he/she does not know what is a good load. Or if the server is not
functioning properly then he/she is able to reduce the load instantly without
having to stop the test entirely.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #5 from Srijon <sr...@gmail.com> ---
Pausing/restarting is not fully implemented. I could not find a way to
implement pausing/restarting with the way threads is currently implemented in
jmeter. Current way jmeter threads are running in fire and forget mode, this
will execute load test fine, but cannot be paused.

But because there is lot of code written around this fire and forget mode of
multithreading, I want to just introduce CachedThreadPool in the first
iteration. If there are any complains from users it can be rolled back. There
are other ways to implement multithreading also which will support
pausing/restarting. This is my thinking, so I just tried to make one change.

But somehow build is failing, I am still not used to jmeter build process and
trying to understand the code and test cases around it. If you can help please
do.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello,
Marking as duplicate of Bug 49974.

If you want help on implementing feature, you should start a discussion on dev
mailing list with your ideas, and proposals, we'll be happy to help.

If you're new to JMeter code base, starting with the Threading Model is not the
good way to start IMO as it is complex and critical.

I'll add comments on other bugs.
Regards

*** This bug has been marked as a duplicate of bug 49974 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #2 from Vladimir Sitnikov <si...@gmail.com> ---
@Srijon, would you please clarify what do you mean by "pause/restart the
threads"?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

--- Comment #4 from Vladimir Sitnikov <si...@gmail.com> ---
>if I see too much load on the server then I am able to pause 50 threads

That is interesting.

However I do not see how the proposed changes correlate with the
"pausing/resuming threads on the fly" feature.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62390] jmeter threads use overloaded run method but not CachedThreadPool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62390

Srijon <sr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.