Jmeter is running only the 1st thread. On putting the load of 2 users, execution for only one user is getting completed successfully, for the other user, the execution gets completed as soon as it starts. The logs are below:-
2019-09-03 14:59:08,648 INFO o.a.j.t.JMeterThread: Thread started: Thread Group Advance Search 1-1
2019-09-03 14:59:13,653 INFO o.a.j.t.JMeterThread: Thread started: Thread Group Advance Search 1-2
2019-09-03 14:59:58,323 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group Advance Search 1-2
2019-09-03 14:59:58,323 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group Advance Search 1-2
Normally you should be getting something like:
Looking into your logs I can see the following:
1st thread started at 2019-09-03 14:59:08,648
2nd thread started at 2019-09-03 14:59:13,653
2nd thread finished at 2019-09-03 14:59:58,323 (after 45 seconds)
So my expectation is that 1st thread is still running. If there are no any suspicious entries in jmeter.log file you can take a Thread Dump (the functionality is available since JMeter 5.1) and see where exactly your 1st thread got stuck
Related
In my ANYLOGIC model there are certain services( some delays the agent from 10 to 15 minutes, others 4 to 8 hrs), using certain resources from a resource pool.
The resources (pool) are available as per a well defined time ( Available: entire week except sunday , 10 am to 1:30 pm and then 2:00 Pm to 6 pm.).
I can see that once a service starts it continues till it finishes itself even after the resource availability time is over.
For example:
A resource is available :entire week except sunday , 10 am to 1:30 pm and then 2:00 Pm to 6 pm.
A service( of 8 hrs delay) starts from 12:30 pm....once it starts, it gets continue till it get finished. Practically it shall release resource from 1:30 to 2 pm and also if the task is not over then it shall not continue beyond 6 pm as well, and shall stop the same and start next day(or next availability).
but it does continue once it starts till it gets finished.
kindly suggest the specific area to be targeted to code or any other option is available?
Define your resource-pool downtimes using a Downtime block. Tick it's "may preempt other tasks" as below:
NOTE: play around with preemption as it interacts with Seize-preemption, resource pool preemption and priorities. Start simple and add complexity only when you fully understand how things work under the hood
I tried to run Thread group with below details:
Number of thread: 50
Ramp-up period: 120
Duration : 300 s
Loop count: 1 (I create a Loop Controller under Thread Group -infinite loop count box unchecked)
HEAP=-Xms1024m -Xmx1024m
and I set a Constant Timer for (5000ms) as think time after the request
The Problem I have ,is the test has exceeded the duration time....and I don't know when it will finish (the command did not show the prompt)
this is the Jmeter log:
09:15:40,486 INFO o.a.j.t.JMeterThread: Stopping because end time detected by thread: Thread Group 1-46
09:15:40,486 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-46
what did I wrong on this scenario?
is there any idea how to fix it....(Link for screenshot):
https://imgur.com/a/We3PfO9
Your Loop Controller does nothing, it controls how many times its children will be executed and since it doesn't have any children it doesn't make any sense.
Your 2 log lines are not very informative, if you want to know for sure where JMeter is stuck you need to take a thread dump and see what exactly the threads are doing. A "blind shot": at least one of your HTTP Request samplers fails to get response in 5 minutes as the application doesn't respond or there is another transport-layer problem. Consider setting reasonable connect and response timeouts at the "Advanced" tab of the HTTP Request sampler (or even better use HTTP Request Defaults)
Your heap size might be too low, consider monitoring heap space usage and garbage collector activity using i.e. JVisualVM
Make sure to follow JMeter Best Practices
I'm running a Java program and I need to get how much time each it spent garbage collecting.
I found these 2 JVM flags:
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
but I'm not being able to find information about it.
I suppose that PrintGCApplicationStoppedTime prints for how long the application time was in a STW, however I am not sure about -XX:+PrintGCApplicationConcurrentTime. Does it print for how long the application was executing concurrently with collection threads?
Thanks in advance.
The names of these flags are not very accurate.
PrintGCApplicationStoppedTime shows how much time the application was stopped at safepoint. Most often safepoints are caused by stop-the-world phases of garbage collection, however, many other reasons exist.
PrintGCApplicationConcurrentTime is how much time the application worked without stopping, i.e. the time between two successive safepoints.
You using those flags to know how long your application
runs between garbage collections.
Eventually that can be calculated from the
GC logs but a convenient way to see that information is with
the command line flags -XX:+PrintGCApplicationStoppedTime and
-XX:+PrintGCApplicationConcurrentTime.
Adding these to your command line produces output such as this:
Application time: 0.2863875 seconds
Total time for which application threads were stopped: 0.0225087 seconds
Application time: 0.1476791 seconds
Total time for which application threads were stopped: 0.0255697 seconds
The application ran (reported in the first line) for about 287 milliseconds and then was
stopped for about 22 milliseconds (reported in the second line).
The flags can be used separately or together.
I am new in Jmeter , I am familiar with LR. But not able to get some functionalities in jmeter for "VUser/Thread Group ".
While I am running my script with 10 threads in jmeter , what does that mean () :-
all 10 users are performing same action at same time
or
each thread is performing separate actions
or
once one thread complete then another thread will start its execution.
How to put 'Rendezvous' function in jmeter for some particular transaction or action like we used write lr_rendezvous("R1"); in Loadrunner to hit all vusers at same time. Is that possible in Jmeter then how ?
If you set number of thread as 10 its loadrunner equalent as executing with 10 virtual users. all threads will start executing at same time.
You can use Synchronizing_Timer for achieving Rendezvous in JMeter
http://jmeter.apache.org/usermanual/component_reference.html#Synchronizing_Timer
https://blazemeter.com/blog/using-jmeter-synchronizing-timer
Concerning the 1st part,
'running script with 10 threads' means that they would all start running at the same time... IF ramp-up time == 0.
If you set ramp-up to [someValue] - the threads will get asynced. See the article from jmeter docs.
Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.
The ramp-up period tells JMeter how long to take to "ramp-up" to the
full number of threads chosen. If 10 threads are used, and the ramp-up
period is 100 seconds, then JMeter will take 100 seconds to get all 10
threads up and running. Each thread will start 10 (100/10) seconds
after the previous thread was begun. If there are 30 threads and a
ramp-up period of 120 seconds, then each successive thread will be
delayed by 4 seconds.
If you are reproducing human behavior a full rendezvous event, more than one person in the same section of code at the same time engaging in the same function, is exceedingly rare....on the order of a credit card company having only 4-5 people in such an incident on the largest shopping day of the year.
So, if you are headed down this path, consider if you are trying to reproduce human behavior or if you have a technical metric you are hitting with a small number of focused users on such an event.
The use of exceptionally highlighted rendezvous use on a resume is a mark of someone you do not want to hire.
In my code i run a cron job which is run for every five seconds, and I've been getting the same WARNING ever since.
this is the api that i used:
sched.add_cron_job(test_3, second="*/5")
And I get a warning:
WARNING:apscheduler.scheduler:Execution of job "test_3 (trigger: cron[second='*/5'], next run at: 2013-11-28 15:56:30)" skipped: maximum number of running instances reached (1)
I tried giving time gap of 2 minutes it doesn't solve the issue.....
Help me in overcoming this issue..
I used the proc.terminate() to stop the execution of my method. So that the instance of the 1st thread is terminated before a new thread could start again.
Also provide a timing mechanism to complete your process well within the scheduled time say within a minute, hour or day etc. In my application i used *sleep(in_seconds)* for providing the timing mechanism.
I had a similar problem, and it turned out it was just your job 'test_3' lasting too long, more then 5 secs (or 2 minutes as you tried).
APScheduler is trying to re-execute you job, but the previous one is still running.