I’m trying to do a load test on my application using Apache JMeter. I’m firing off 500 requests like this:
http://localhost:9001/person/1
http://localhost:9001/person/2
…
http://localhost:9001/person/500
The problem is I’m not seeing any performance difference between blocking code and non-blocking code. Both approaches can handle about 100 requests per second.
This is my blocking code:
public Result getPerson(Integer id) {
ObjectNode result = Json.newObject();
Person person = null;
person = jpaApi.withTransaction(entityManager -> {
Query query = entityManager.createQuery("select p from Person p where id = :id");
query.setParameter("id", id);
return (Person) query.getSingleResult();
});
return ok(person);
}
And the non-blocking code I got from here https://github.com/playframework/play-java-jpa-example , and I simply added a method to find a person by id.
Both blocking and non-blocking approaches can handle about 100 requests per second. Am I doing something wrong? Could it be a limitation with JMeter? I’m using play 2.6.9 by the way.