Using Cloud Profiler I found out that my service is spending more than 99% of the time waiting. The difference between CPU time and Wall time is massive as you can see in the above linked images.
This is the first time I'm using Cloud Profiler and the Google documentation says the following:
If the wall-clock time is significantly longer than the CPU time, then that is an indication the code spends a lot of time waiting. This might be an indication of a resource bottleneck.
If the CPU time is close to the wall time, then that indicates the block of code is CPU intensive; almost all the time it takes to run is spent by the CPU. Long-running CPU-intensive blocks of code might be candidates for optimization.
This makes sense, however,
- I'm looking for a list of common mistakes that can lead to Wall time >>> CPU Time and the best practices to be followed to reduce that gap.
- What could be the reasons for a resource bottleneck in AppEngine? (if you can point out a specific root cause by referring to the linked images, that'll be much help)
My service is deployed on AppEngine standard environment over an F4 instance class with a runtime of Java 11.