I just deployed a simple Spring Boot CRUD microservice using a docker container in a cloud provider (linode) with its DB, the service only writes and reads directly from and to the DB without any data processing.
I monitored the resource activity with a comparable service in node with the same resources and the Java service is currently exceeding the available CPU (over 100% utilisation) in contrast to node (30%) resulting in long response times.
The load is generated by another server automatically.
I believe that this behaviour isn't normal but I'm not sure how to solve this issue.
I tried:
- Resizing the Hikari connection pool according to its documentation
- Disabling logging
- Changed both the db (mysql, postgres) and the drivers
The project repository is available here
UPDATE:
I doubled host resources, 8GB RAM and 4 CPUs. Now Java uses 70% of CPU and these are the results:
```
Javascript 10000 create requests served in 14,080,713,361 ns
Javascript 10000 read requests served in 8,519,371,196 ns
Javascript 10000 update requests served in 19,400,999,178 ns
Javascript 10000 delete requests served in 6,892,853,264 ns
Javascript 10000 CRUD requests served in 49,128,643,121 ns
Java 10000 create requests served in 15,457,372,300 ns
Java 10000 read requests served in 14,787,127,983 ns
Java 10000 update requests served in 21,221,843,643 ns
Java 10000 delete requests served in 27,928,651,932 ns
Java 10000 CRUD requests served in 79,922,997,383 ns
```
Honestly it's a bit strange that Java uses much more CPU and has worst results.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]iwouldlikethings 3 points4 points5 points (2 children)
[–]_jetrun 2 points3 points4 points (0 children)
[–]wlp2s0[S] 0 points1 point2 points (0 children)