You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2015/11/02 21:09:14 UTC

Re: 80ms delay switching between worker threads

Farzad,

On 10/31/15 2:11 AM, Farzad Panahi wrote:
> Hi Chris - I am using a linux instance on amazon cloud.

You may be seeing either of the following:

1. Loss of real-time clock resolution due to virtualization
   (or support from the host OS)
2. Delays imposed on your instance by the hypervisor to maintain QoS
   for other users on the same hardware

Try this on real hardware; otherwise there is too much chaos in a
virtualized environment to be able to draw concrete conclusions.

-chris

> On Oct 30, 2015 7:43 PM, "Christopher Schultz" <ch...@christopherschultz.net>
> wrote:
> 
>> Farzad,
>>
>> On 10/30/15 6:10 PM, Farzad Panahi wrote:
>>> Thanks for the explanation David.
>>>
>>> I added System.nanoTime() to get high resolution numbers. Nano second
>>> numbers are telling me the same thing. When thread changes we see a
>>> difference of about 82ms (3082462134714 - 3082379268473 = 82866241).
>>> Within the same thread the time difference is something between 84 to
>>> 22 micros seconds (3082462218770  - 3082462134714 = 84056) ,
>>> (3082462241008  - 3082462218770  = 22238).
>>>
>>> I think if it is a time resolution issue it should apply to all log
>>> lines. Why is it the case that only when thread is switching we see
>>> this huge hiccup? Thread context switch affects this but it cannot be
>>> in order of milli seconds.
>>
>> What OS are you using? IIRC, the Windows timer has horrible resolution.
>> you can call System.currentTimeNanos all you want, but you won't get
>> anything meaningful lower than some threshold regardless of the actual
>> least significant digits coming back from those calls.
>>
>> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org