I have created a web application that contains several large calculations. When a user uses the application to do these calculations, it takes less time (10-20 seconds). But when multiple users tries to do the calculations together, it takes a lot of time (10-20 minutes). When multiple users use the application for smaller tasks it works fast as expected. Problem occurs while larger calculations.
Why is this happening? Is this for processor's core/thread number? Or is this for the database keeping data locked during multiple requests?
What can be done to solve it?
Is there async await in Java like in C#, Javascript?
I have used Java, Spring, Hibernate, JPA, Tomcat, MySQL, Thymeleaf