Issue on Performance testing of H2 database using Jmeter JDBC requests - jdbc

Facing some issue while running the performance testing of H2 database for a corda project.
JDBC requests in Jmeter is used for this testing .
some screenshots of Jmeter is given.
jdbc connection issue
jdbc reruest
result

Your question doesn't provide any error details therefore we cannot come up with the comprehensive solution, going forward make sure to include the screenshot or text of the "Sampler Result" tab of the View Results Tree listener and at least the relevant part(s) of the jmeter.log file into your question.
The most possible reason is using the wrong validation query, what you supplied is for Oracle DB, for H2 you should be using just Select 1
Also make sure to put the H2 JDBC Driver to JMeter Classpath and restart JMeter to pick up the .jar
Check out The Real Secret to Building a Database Test Plan With JMeter article for more information on the database load testing using JMeter.
P.S. Be informed that having JMeter and the application under test on the same machine is some form of a performance-testing anti-pattern as both are very resource intensive and in case of CPU/RAM/whatever lack you won't get reliable results.

Related

JMeter - After Delete SQL, should I run a explicit commit

I have this SQL that I'm running through the JMeter script using JDBC request.
Query Type: Update Statement
SQL:
delete from auth_table where auth_key < to_char(trunc(sysdate-${RetentionDays}),'YYYYMMDD') and rownum< ${NumberOfRecords}+1
Do I need to add another JDBC request only for commit?
The issue is with RetentionDays value being defined as 0. If it is a non-zero value it works
Depends on Auto Commit flag in JDBC Connection Configuration
Turn auto commit on or off for the connections
Normally JMeter shouldn't "hang" the main idea of the database load testing is that you should be sending exactly the same requests as your application (or other database data producer/consumer) does. You can look into your database logs and compare the requests which application and JMeter send, identify and eliminate the differences.
If you don't have access to the database server instance you can try the following JMeter-side troubleshootings:
Take a thread dump, it can be done either from JMeter GUI directly
or using JDK built-in tools, this way you will see where exactly JMeter "hangs"
Another option is increasing JMeter logs verbosity for JDBC test elements, it can be done by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.protocol.jdbc" level="debug" />

how to create XX number of users in mongoDB using jmeter and use these users to test login/authorization performance scenarios

We are using MongoDB and need to create n users to test the performance of login scenarios by passing these users in JMeter, I can use CSV file to pass username/password values however for this I need to first create 500 users in DB. I saw some info on the net saying to use MongoDB script to generate data but this is Depreciated.
Please suggest how can I create these users.
how to create XX number of users in MongoDB using JMeter and use these users to test login/authorization performance scenarios.
MongoDB test elements were marked as "deprecated" due to low interest of the users in this functionality, however they still can be used.
Add the next line to user.properties file (lives under "bin" folder of your JMeter installation)
not_in_menu=
this way you will be able to restore the access to deprecated test elements via JMeter GUI
Restart JMeter to pick the property up
You should now see and use MongoDB Source Config and MongoDB Script test elements to establish MongoDB Connection and execute arbitrary queries.
See How to Load Test MongoDB with JMeter article for detailed information on working with MongoDB with JMeter.

How to create new users with JMeter

I have to perform load and performance testing of my new site which requires login functionality. I am using JMeter to test performance and load. Can you please send me the details of how I can create multiple users to the database by using JMeter, so that I can use them to login multiple users at a time?
Thanks.
JMeter is a Load testing tool and not a data creation tool.
It should be used for load testing and not functional aspects.
Though it can be used for data creation because of its record and replay feature. (of course with parametrization)
To create data,
you need to record create user scenario using JMeter.
parametrize add user request (username,details)with csv data set config element.
add CSV data set config with required no. of entries (500 in your case) where each line represents user details,
user1,India,passwd1
user2,US,passwd2
run script with 500 threads (not advisable but a possible way) or single thread with 500 loop count.
This will create users with data from csv. After that you can load test your website.
First of all you need to set following things to your Jmeter test plan :
1 - Thread group - Here you can set parallel users[Ex: 450 users] , ramp up period[Ex: 300 seconds] and loop count[Ex : 5]
2 - Login page with get and post method
3 - Listener like summary report , table , tree or other which is suitable for you.
Reference detailed link for login process : How to do login using Jmeter
Please let me know if you have any confusion during your load testing.
If you need to create users directly in database the correct JMeter Test Element is JDBC Request sampler which allows to execute arbitrary SQL queries against any database which supports JDBC protocol.
Download a relevant JDBC driver for your database and drop it to /lib folder of your JMeter installation
Restart JMeter if it's running (jars loading isn't dynamic and performed on start)
Add JDBC Connection Configuration element to your Test Plan or Thread Group and populate at least the following fields:
Variable Name
Database URL
JDBC Driver Class
Username and Password
Configure JDBC Request to insert email/password pairs. You can use it in conjunction with CSV Data Set Config so user credentials could be read from CSV file.
See Building a Database Test Plan guide or select File -> Templates -> JDBC Load Test to get idea on how your Test Plan should look like.

Jmeter test fail on same app different servers (Spring webflow + Primefaces)

I'm having a weird problem with JMeter.
Scenario:
Web app running on localhost
Record a simple test on Jmeter (login + 1 search)
Execute the test on localhost with Jmeter. Test runs OK.
Change the server and port on HTTP Request Defaul for another server's IP and port running the same version of the app.
The test runs but fails at the search with ".FlowExecutionRestorationFailureException: A problem occurred restoring the flow execution with key 'e3s2'"
If i do the same swapging servers (record on remote server and try to execute on local) the behavior is the same.
¿Any clues of what can it be? I don't understand why it manages to do the login and navigate on another server but fails on other action.
In short, if I record a test it fails at somepoint if I change the server.
Software_
Jmter 2.12
Primefaces 5.0
Spring Webflow 2.3.1.RELEASE
Apache Tomcat 7.0
My expectation is that there is at least one dynamic parameter which is currently being hardcoded into your script. I would suggest to do the following:
Record your login+search flow once again
Inspect 2 .jmx scripts to detect any differences (i.e. one or more parameters having different values)
Once you find those problematic parameters you'll need to look into server's response body/headers/cookies/ to see where it lives.
As soon as you know where the parameter value lives you can use one of the following PostProcessors:
Regular Expression Extractor
XPath Extractor
CSS/JQuery Extractor
The whole process is called "correlation" so you can use "JMeter correlation" as a search term if above information is not enough to resolve your problem.
The problem was some xhtml components that didn't had any specified Id so jsf would set something like id="mainForm:j_idt12". Since my test don't need to work on dynamic generated html (are simple tests) setting the ids solve the poblem.

VS2010 Load Test Failing - Cannot Open Database - NOT The Load Test Results database

Hi I have been battling with this issue all day. I have a vs2010 load test which consists of three scenarios which are composed of three different web performance tests.
Each of the web performance tests select urls from a database which is configured correctly and runs locally. However when the load test is run remotely it fails with the error:
Could not run load test 'Load Test' on agent 'AGENTSERVER'. Could not open the database 'URLSDB' requested by the login. login failed for useraccount
In an attempt to get this working the agents and controller are set to run under a domain admin account, I can login to the database through Management Studio. I've checked the connection string and can run the test locally but not remotely. Does anyone have any ideas? My next step is to set the connection string to the UrlsDB to use SQL Authentication
Finally managed to resolve it at 01:20AM. When checking the datasources of three individual tests which made up the mixes in the scenario, I found that the UI was showing that once one had been updated all three updated the connection string so that is why I was baffled as to why I was getting these errors, plus the error doesn't indicate which connection was having the issue.
So to eliminate the tests as being the issue I removed the datasource from each test and created individually named brand new datasources all till effectively pointing to the same sql server and the same database. Then I ran the tests and all performed correctly, finally!!
So the core issue was the connection strings in the underlying tests were incorrect. Will be testing the UI further to check if I was just my own error or there may actually be a bug in the UI, if I find a bug I'll report it.
Thanks to those who took the time to try to help me solve it, gutted that the issue was so minor when it had me baffled for nearly 20 hours :/
The domain admin account you are running the test from cannot connect to the database server from the agent machine.
Log into the agent and debug the database connection from there.
Please be aware that a thread blocking call inside a web test, such as this may cause issues with your load test. I recommend that you load all test url's during the test instanciation if at all possible.
Essentially minimise the database calls to as few as possible.

Resources