Nisha V
Nisha V

Reputation: 35

Error performing load testing using jmeter

I am trying to perform load testing using JMeter in which I have recorded a script using HTTP script recorder. now I have to perform the same test with multiple users, hence using a .csv file containing the details of 5 users.now when the test script is run after configuring for 5 users and suppose there are 5 HTTP requests.then some of the requests fails showing the error below:-

PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

in Connector.php line 55
at PDO->__construct('mysql:host=localhost;port=3306;dbname=forge', 'forge', '', array('0', '2', '0', false, false)) in Connector.php line 55
at Connector->createConnection('mysql:host=localhost;port=3306;dbname=forge', array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 60
at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 49
at ConnectionFactory->make(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql'), 'mysql') in DatabaseManager.php line 175
at DatabaseManager->makeConnection('mysql') in DatabaseManager.php line 67
at DatabaseManager->connection('mysql') in Model.php line 3224
at Model::resolveConnection(null) in Model.php line 3190
at Model->getConnection() in Model.php line 1870
at Model->newBaseQueryBuilder() in Model.php line 1813
at Model->newQueryWithoutScopes() in Model.php line 1432
at Model->save() in ActivityController.php line 19
at ActivityController::logUserActivity(object(Request), 'visited', array('url' => 'http://localhost/busnet/Source/Main/Services/public/index.php/post', 'method' => 'POST', 'requested_on' => '1508130477.865', 'responded_on' => '1508130477.8878', 'ip_address' => '127.0.0.1', 'status' => '200')) in ActivityMiddleware.php line 52
at ActivityMiddleware->addToActivityLog(object(Request), object(JsonResponse)) in ActivityMiddleware.php line 34
at ActivityMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ActivityMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AuthMiddleware.php line 74
at AuthMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AuthMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CorsMiddleware.php line 26
at CorsMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CorsMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Application.php line 1451
at Application->sendThroughPipeline(array('App\Http\Middleware\CorsMiddleware', 'App\Http\Middleware\AuthMiddleware', 'App\Http\Middleware\ActivityMiddleware'), object(Closure)) in Application.php line 1221
at Application->dispatch(object(Request)) in Application.php line 1161
at Application->run(object(Request)) in index.php line 30

this is my .csv in notepad

[email protected],test@123,DATE,DESC,null,1,2,[email protected]
[email protected],test@124,DATE,DESC,null,3,3,[email protected]
[email protected],test@125,DATE,DESC,null,4,4,[email protected]
[email protected],test@126,DATE,DESC,null,5,5,[email protected]
[email protected],test@127,DATE,DESC,null,6,6,[email protected]

and the CSV dataset config is as follows
https://i.sstatic.net/BcJD5.png

The error appears for different requests for each run ie sometimes the same request send by 4 out of 5 user passes but one fails.

Can anyone please help me out to resolve this?

Upvotes: 0

Views: 229

Answers (1)

MonkeyTester
MonkeyTester

Reputation: 139

Just a guess, but could this be due to mysql not being configured to accept concurrent logins? You could test this by putting everything in the Jmeter thread group under a Critical Section controller:

https://jmeter.apache.org/api/org/apache/jmeter/control/CriticalSectionController.html

Upvotes: 0

Related Questions