This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Accounting for unaccounted time spent serving a request  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
Saloon Keeper
Posts: 2260
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
yeah, i had checked the average round-trip latency using ping in terminal
 
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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

 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!