https://bz.apache.org/bugzilla/show_bug.cgi?id=68884

--- Comment #6 from Matt M <inconceiva...@gmail.com> ---
(In reply to Christopher Schultz from comment #5)
> I'm ignorant of the threading details of Websocket, so maybe this is a
> stupid question: Could a single thread be used to perform these kinds of
> cleanups, instead of an army of threads? That would let a single thread
> trigger many session-shutdowns and only yield once for each of them.

My understanding is that there is a single write semaphore per remote endpoint
socket so the threads trying to write their close messages are in contention
for that and yield rather than block waiting in tryAcquire which was the
original behavior pre bz66508.

The spin count in yield can run into the thousands even for a relatively short
expiry period which puts additional pressure on the OS level thread scheduler. 
More than one http thread can be in this spin wait.

Given that its waiting for a write semaphore, I am not sure if a dedicated
close  thread would help - I think a similar approach may have been used a
while back in jetty.  That write semaphore is used for any write, not just
closures.

Is this something that can be looked into for 9.0.89?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to