0
votes

I have a REST service written in Spring Boot which have only GET and POST methods. The GET/POST method retrieve/post data from/to cassandra cluster. I tried testing the REST service with 100 users running concurrently. My jmeter configurations are:

No of users When I run this test, for the first few request it gives errors and half request is successful. Here is the result table Result table

Then I checked the reason of error in the Result tree and found this response data:

{"timestamp":1474278650822,"status":500,"error":"Internal Server Error","exception":"com.datastax.driver.core.exceptions.NoHostAvailableException","message":"org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)","path":"/post"}

I couldn't figure out why it failed to connect to cassandra cluster for the first few requests.

I am new to cassandra, REST service and jmeter. Can anyone point out what mistake I am making. NOTE: I have tested my REST Service using Postman, and it functions well, both GET and POST request.

2

2 Answers

2
votes

With this configuration you're hitting the service at once with 100 requests. Each request will get a request thread, therefore I assume your service has a thread-pool with at least 100 connection threads. Each request thread tries to obtain a connection to the DB from the DB Connection pool. If 50% of your requests fail, I'd guess, your DB Connection Pool size set to 50. In case your DB connection pool can handle 100 connections, check the connection settings of your Cassandra DB, maybe that one is limited to 50.

1
votes

There is few more to add with the answer of @Gerald. The number of threadpool limitation in the DB might not be the only culprit, the other possibilities are the max thread connections set in the server level as well. If you have the access to the server log of the api your trying to test, you can get exactly at what point it breaks and fix it with help of developers