I've set of sql-files they need to execute in parallel and I've achieved it by ThreadGroups.
I've created 2 thread groups. Each TG will start each sql-file, But, they are running with same database-user.
I need to run the TG1 with user1 and TG2 with user2. Can we achieve it throw single jmx ?
You can use 2 (or more) JDBC Connection Configuration which will be similar except the user and password
When you write your JDBC Request give the relevant Variable Name from the Configuration.
Variable Name
Name of the JMeter variable that the connection pool is bound to. This must agree with the 'Variable Name' field of a JDBC Connection Configuration.
Related
In SnapLogic, is there a way to paramertize the database connection info so you can create a reusable pipeline that can pass the db connection info for the account of a select snap?
In pipeline properties, add a parameter named "awsdb" and its value as the "Account Name". Now, in database access snaps, use the above created parameter to dynamically load the connection info based on parameter value.
The database connection information cannot be passed as parameters (and it should not be). You have to create separate accounts for each connection.
As per this answer here, you can pass the account name as a pipeline parameter and configure the database read snap to connect to whatever instance it is supposed to connect to.
A better way to do this is to have an expression library file that will contain the account information and pass the schema name and table name as pipeline parameters. In this way, you can use the same pipeline to extract data from different tables in various schema using the same connection. This can be done by dragging and dropping this pipeline wherever you need it or using pipeline execute to call it from a different pipeline. You can maintain multiple such expression library files configured to different accounts.
Creating a pipeline with schema name and table name passed as pipeline parameter and an expression library file containing the account information:
Configuring the schema name and table name in the settings tab of the snap:
Getting the account information from the expression library file:
The expression library file config.expr used in this example:
{
"account": "../shared/TEST"
}
It works:
Note: As you can see, I created a Generic Database Account named TEST in the shared folder of the project space I was working in. This account contains all the connection information.
Hope this helps :)
I'm executing JMeter loadtest on my system. We have 1 client server with JMeter GUI and 2 slaves servers.
e.g.
client: 192.168.1.1
slave1: 192.168.1.2
slave2: 192.168.1.3
We are testing application where I need to login, do something and logout.
Is it possible to test such application with 2+ slaves? Because I cannot login with the same user more times on server in current session. I get license error: "User is connected from another machine".
I know, that jmeter multiplies Threads with number of slaves, but how to handle this situation?
Thanks
JMeter uses local CSV files in distributed mode. So you just place different files on each slave and it works.
For distributed testing, the CSV file must be stored on the server host system in the correct relative directory to where the JMeter server is started.
According to the Apache JMeter documentation,
By default, the file is only opened once, and each thread will use a different line from the file. However, the order in which lines are passed to threads depends on the order in which they execute, which may vary between iterations.
If you want each thread to have its own set of values, then you will need to create a set of files, one for each thread. For example test1.csv, test2.csv, …, testn.csv. Use the filename test${__threadNum}.csv and set the "Sharing mode" to "Current thread".
So just put your different credentials in different CSV.
Either of below solutions will address your issue. I use Redis. It is super cool.
Redis:
http://www.testautomationguru.com/jmeter-make-data-sharing-easy-in-distributed-mode-using-redis/
HTTP Simple Table Server:
https://jmeter-plugins.org/wiki/HttpSimpleTableServer
I have a requirement wherein I need to run different jmeter testplans on different target servers. I went through this PDF here, but it does not meet my requirements. It explains how to stress a "single" webserver from different slaves using single jmeter master. But my requirement is to stress different servers from different slaves using single jmeter master. One way I could find is like below
Open multiple jmeter GUI instances on the jmeter master.
Create different testplans in each jmeter instance (basically these testplans differ only in terms of target server and login information)
Go to Run -> Remote Start -> Choose different slave in each instance
But I don't like this myself. Is there any better way to achieve this..?
Not sure that it`s a best way, some workaround:
Start the jmeter servers with some parameter :
SERVER_PORT=44444 ./jmeter-server -Jparam=1 &
SERVER_PORT=44445 ./jmeter-server -Jparam=2 &
SERVER_PORT=44446 ./jmeter-server -Jparam=3 &
Add this parameter in your testplan (in user defined variables):
And in testplan add a thread group and inside of this thread group a several If controllers with conditions like a ${__javaScript(${param}==1)}. Inside these If controllers put your different testplans:
Theriotically, they will start to work with different "branches". Also you can change the number of users depends of this parameter by using Beanshell and to use different pools for user names/password using CSV controller. ( /home/pools/${param}/pool.csv)
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.
I have a web service that calls some stored procedure on a AS400 via JTOpen.
What I would like to do is that the connections used to call the stored procedures was opened in a specific subsystem with a specific user, instead of qusrwrk/quser as now (default).
I think I can be able to clone the qusrwrk subsystem to make it start with a specific user, but what I cannot figure out is the mechanism to open the connection in the specific subsystem.
I guess there should be a property at connection level to say subsystem=MySubsystem.
But unfortunatly I haven't found that property.
Any hint would be appreciated.
Flavio
Let the system take care of the subsystem the job database server job is started in.
You should just focus on the application (which is what IBM i excels in).
If need be, you can tweak subsystem parameters for QUSRWRK to improve performance by allocating memory, etc.
The system uses a pool of prestarted jobs as described in the FAQ: When I do WRKACTJOB, why is the host server job running under QUSER instead of the profile specified on the AS400 object?
To improve performance, the host server jobs are prestarted jobs running under QUSER. When the Toolbox connects to a host server job in order to perform an API call, run a command, etc, a request is sent from the Toolbox to an available prestarted job. This request includes the user profile specified on the AS400 object that represents the connection. The host server job receives the request and swaps to the specified user profile before it runs the request. The host server itself originally runs under the QUSER profile, so output from the WRKACTJOB command will show the job as being owned by QUSER. However, the job is in fact running under the profile specified on the request. To determine what profile is being used for any given host server job, you can do one of three things:
1. Display the job log for that job and find the message indicating which user profile is used as a result of the swap.
2. Work with the job and display job status attributes to view the current user profile.
3. Use Navigator for i to view all of the server jobs, which will list the current user of each job. You can also use Navigator for i to look at the server jobs being used by a particular user.