I am having a strange issue in production cloud servers.
I have a server java method (REST service method) which have logs in first and last line of method.
The issue is that the method call in access logs shows 10 times more delay than the time difference as present in tomcat logs.
For instance tomcat logs shows method executed in 1 seconds while access log shows 13+ seconds. The same delay is observed in network tab of browser.
Is there any way to understand the delay? I checked the server disk status and it shows 20 to 30% usage. The memory usage reached 80% max and CPU is also fine.
What can be the reason for the intermittent delay as per access logs?