• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accounting for unaccounted time spent serving a request

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have an API which returns xml results based on queries, the server is running Tomcat 7.0.53. I've been trying to determine how much time is spent processing and serving the request, and there is a significant amount of time (104ms, on average) that I can't account for during the application execution. One thing I have thought of is that Tomcat might be using up some or all of this time before and after executing the relevant web app.

My question is: what are the possible causes of this unaccounted time? Does anyone know of methods or tools that I can use in order to analyze the time Tomcat is spending loading classes, assigning threads, etc?

By the way, the time was determined by comparing the total time spent in the application vs the TTFB reported by Chrome Dev Tools.
 
Marshal
Posts: 4489
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

bad mad wrote:.. the time was determined by comparing the total time spent in the application vs the TTFB reported by Chrome Dev Tools.


Did you take network latency in to account?

 
Dante Ko
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah, i had checked the average round-trip latency using ping in terminal
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dante Ko wrote:
My question is: what are the possible causes of this unaccounted time? Does anyone know of methods or tools that I can use in order to analyze the time Tomcat is spending loading classes, assigning threads, etc?

By the way, the time was determined by comparing the total time spent in the application vs the TTFB reported by Chrome Dev Tools.



If the Google tools measures the full round trip, meaning from the call to Tomcat to the response, then the difference is the portion of the application that it doesn't measure. This means the time from the initial timestamp to the Tomcat call, and the return from the call to the final timestamp. And since this is measured in milliseconds, I would think that it is likely queuing. Regardless, the possible causes are...

1. Lots of work being done prior to the call and/or after the return of the call.
2. Queuing. For example, the response comes back from Tomcat, but the application is busy working on other responses. This means that the response has to wait its turn for processing, and for the end timestamp.
3. Out of sync clock. Please make sure that the same thread that takes the start time also take the end time. Some OSes, don't keep the clocks in sync between threads, so, you are measuring the out of sync of the clocks.

And to answer your question... Unfortunately, you will need to know what your application is actually doing. This can probably be easiest done with a profiler.

Henry

 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic