JSR223 Preprocess performance issue Jmeter - jmeter

I have an scenario to measure login function performance for that i have used JSR223 preprocessor to encrypt my password using Javascript its around 2000 Line of code it works fine it encrypts the password successfully, i can able to login using my script it works fine in small number of users.
If we go for an large volume of users script finish first 3 steps very fast once it reaches JSR223 preprocessor thread it takes long time to process it makes delay in performance test.
Any suggestion to fine tune this process ?
Already i have configured the cache size as 1024 even though it takes long time to execute.
For 600 Users it takes 1hr +++ time to finish the process with 1 Master and 3 slaves environment.

Javascript should be avoided for Load Testing.
The best option is to use:
Groovy
Check Cache Compilation Key
Enter a unique key per Test element
This will make JMeter compile the script leading to most optimal performances, read this for more informations:
http://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
If you're looking to learn jmeter correctly, this book will help you.

JavaScript is not the best language to use with JSR223 PreProcessor, it's being run via Rhino or Nashorn engine and your expression is being evaluated all the time from scratch using not very performant way.
According to JMeter Best Practices it is recommended to use Groovy scripting engine. Assuming good configuration you will be able to get groovy scripts compiled into native JVM bytecode hence performance will be much higher than for JavaScript.
In order to get Groovy support in Jmeter you just need to
Download groovy-all.jar
Drop the file to "lib" folder of your JMeter installation
Restart JMeter
See Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide for more detailed explanation and scripting best practices.

Related

jmeter with BI4 .2 SP6

I have recorded script through Blaze meter and tried executing thru jmeter after adding com.sun.faces and bttoken. I have tried adding sEntry but unfortunately I didn't find the key.
Issue: It is not performing refresh report activity because I was monitoring in the backed sessions.
Looking into BI4 Web Intelligence Performance Test with JMeter article it should be strEntry and the relevant Regular Expression Extractor configuration would be something like
Actually you can use another approach to recording JMeter tests which can export recorded scripts in "SmartJMX" mode with automatic detection and correlation of the dynamic data, it might help you to come up with the properly correlated version of the load test with the minimal efforts. Check out How to Cut Your JMeter Scripting Time by 80% article for more details.
If you need further help on manual correlation consider including previous sampler response and the next request details into your question

How do I perform a complete Load Test process with JMeter?

I am new to using JMeter and have developed a basic test plan with HTTP Sampler and a few listeners. Please run me through the entire process of how I can start after opening JMeter ?
There's no right answer for this, it depends what you're wanting to achieve. I'd suggest starting with the best practices: http://jmeter.apache.org/usermanual/best-practices.html
And also look at building a web test plan: http://jmeter.apache.org/usermanual/build-web-test-plan.html
I would look at the Graphs Generator listener - https://jmeter-plugins.org/wiki/GraphsGeneratorListener/ - use these graphs to make sure you're making the number of transactions that you would expect in your tests.
Basically - the documentation is your friend. I took time to read what each controller, listener and sampler was doing and decided how to implement these myself. There was some trial and error. JMeter is an easy tool to pick up and use but there's a LOT of depth to it.
In addition to Ali1874 answer, I would suggest looking into how to run JMeter tests using command line. You can find more information at http://jmeter.apache.org/usermanual/get-started.html#non_gui. With regards to reporting JMeter is able to produce nice HTML reports when using -e -o options http://jmeter.apache.org/usermanual/generating-dashboard.html#report_after_load_test.
Also, with regards to Jmeter test plans, in my previous company we used to parameterize number of threads required, servers and other elements. In general structure looked like the one at the example test plan.
We had different user defined variables elements for different environments for faster test tuning. Also, we used bzm – Weighted switch controller (https://github.com/Blazemeter/jmeter-bzm-plugins) to distribute load among endpoints by including HTTP requests from Test Fragment element so that we would not have to duplicate requests allowing to manage them more easily. You can check out full plan at here (https://github.com/gretard/testing/blob/master/00-jmeter/results/samplePlan.jmx). Please bear in mind that test plan uses bzm – Weighted switch controller plugin and jpgc - Standard Set plugin which you can install by using Plugins manager (https://jmeter-plugins.org/wiki/PluginsManager/).
Hope this will help.

can we have any jmeter control over the threads?

can we have any control over the threads?
Consider i have 10 threads and i have provided my test data in .csv file. so can I control on threads like which thread should pick which data and may be some delay for few of the threads?
Also, can someone suggest me some book or online content wherein i can have information on internals of JMeter. Like when we run test plan, what all things are happening on memory side, reading of different properties files, receiving response, how threads internally works, etc.
Thanks,
Abhishek
JMeter is a very flexible and powerful tool. In theory, anything is possible it all depends on what your testing goals are. Even things not supported by JMeter can be coded in Java and easily integrated with a Java Sampler. Your question indicates you have not spent a lot of time experimenting with the tool, but hopefully my answer jump-starts that process for you.
JMeter has a lot of control features that can be used in conjunction with CSV data to control the flow of a thread. For example, use the CSV data to correctly enter the right block of a Switch Controller, validate an If Controller, or control the number of loops in a Loop Controller. Be sure you read the entire Getting Started Guide and familiarize yourself with the Component Reference Guide
In terms of how things work internally, your best bet is to build the JMeter project from source in an IDE like Eclipse. You can then step through the entire program in as much detail as you want.
Tutorial: Build JMeter from Source
Also, the /bin/jmeter file has a decent number of comments about how to properly configure JVM memory for a JMeter process.
You probably want to install at least the most basic JMeter Plugin Package.
Lastly, if you need one thread to control the behavior of another thread you can use FIFO Queues or set JVM properties via Beanshell which are global and not unique to a thread like runtime variables.
props.put("key","value");

Optimizing JMeter scripts for low end servers

I'm have a simple JMeter script with 300 threads that checks a list of 30 static URLs with a 2 second delay between requests.
I'm hitting CPU usage limit on my machine (EC2 Large Server).
Any idea on which switch and levers have the greatest impact on server resources?
For example:
Number of threads
Delay between requests
Number of steps (URLs) in script
Versions of JMeter (2.9 vs 2.10)
Thanks
Ophir
Just make sure that you've
Disabled all listeners
Running JMeter in non-GUI mode, i.e. via command-line, Ant, Maven or whatever
Your Post Processors (if any) aren't resource-consuming, i.e. you're trying to extract something with Regular Expression Extractor from immense output.
You're using the latest version of JMeter and Java (JMeter 2.10 is better than 2.9)
You're using 64-bit Java with enough heap space provided
You're following JMeter Best Practices
If you problem still persists, you can consider looking into following options:
Profile Java process running JMeter to detect what classes are most CPU-consuming
Use several "lesser" EC2 instances with 1 JMeter "master" and 2-3 slaves
If you have static URLs, just:
Use a CSV DataSet which will contain these URLs
One HTTP Request Sampler that will use it
With a large Server, 300 threads is really nothing.
You may read :
http://jmeter.apache.org/usermanual/best-practices.html
http://www.dzone.com/links/see_how_to_make_jmeter_run_thousands_of_threads_w.html

jmeter scripting for application

We had scripted an .exe application in load runner and We would like to try it out with JMeter.
The script is very complex and I'm not sure if JMeter could support it, any possibilities available?
I have been a devoted user of Apache JMeter for the past decade and it does offer helpful web load testing functionality for free. Here are some pointers that may help determine if JMeter is right for you:
Apache JMeter is a Java application, so it does have upper limits on resources (memory, sockets, threads). These resources can often be increased or consumption optimized (standard JVM args or jmeter.properties file) for better performance under heavy load testing.
When capturing scripts using the "HTTP Proxy Server" node, make sure that you have a "User Defined Variables" node created and populated with your name/value pairs for the test. This will trigger a variable substitution in the proxy server. This is invaluable when you want to parameterize the script.
As with tree based structures, position determines scope. Make sure that you isolate actions under the proper node or else they will execute for everything at the same scope.
For simulated delays, I have had a good run with the "Uniform Random Timer" where you can specify a lower and upper limit.
For validation, the "Response Assertion" is helpful for raw strings and regular expressions.
For variable extraction, the "Regular Expression Extractor" allows you to extract a value from a page and reference it in a variable for the rest of the test. Node scope appears to be treated as global for these extractors.
When watching the test, "Aggregate Graph" is helpful. "View Results Tree" is useful when troubleshooting, but adds extra memory usage to tests and can cause heavy tests to fail. Note that if you save the results on a listener node, you can reload those results in the control at a later time. Also, if you highlight the table in "Aggregate Graph" or "Aggregate Report", you can paste the results into Excel directly. Very helpful for reporting.
Hopefully this gives you an idea of some of the value and gotchas with Apache JMeter.
You have built a test script within Load Runner and you want it to simply run in JMeter — that's not gonna happen. These are two different test tools.
Rebuild the script in JMeter and it will run as smoothly as your script with Load Runner.
Now you can execute JMeter script inside Load Runner, check
How-to run JMeter test in LoadRunner:
Starting with Micro Focus LoadRunner (LR) 12.55 and Performance Center (PC) 12.55, you can execute JMeter tests in addition to other LoadRunner scripts.
Setting for LoadRunner scenario with a JMeter test:
Open LR Controller
Select the JMeter Scripts radio button
Press the Browse… button
Select JMeter Test file (e.g. Test_1.jmx) and click Open
Click OK button on the next window

Resources