You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex O'Ree <al...@apache.org> on 2024/02/09 13:47:19 UTC

Long lasting websocket sessions

I've been experimenting with tomcat 9.x in seeing how long i can get a web
socket session to last. I'm currently struggling to get past 30 minutes or
so. Looking for guidance on how to best increase this or if this is a bad
idea.

Here's the current configuration and what i've tried thus far:

The server continuously streams messages the client, about 1 per second
The client periodically (every 30 seconds) sends a keep alive text message
back to the server
The server side endpoint sets the Session.setTimeout(0); according to the
docs, this should prevent timeouts
The server side WAR file/WEB-INF/web.xml had a session timeout defined at
15 minutes but i then removed it in order to increase the websocket
duration.

Despite all this, both the client and server log a session disconnect, but
i'm still not sure what the reasoning is. I'm still assuming it's some kind
of timeout mechanism.

Re: Long lasting websocket sessions

Posted by Alex O'Ree <al...@apache.org>.
No devices in-between, browser to local host. Good feedback though, I'll
try to reproduce with the snake app
Thanks!

On Fri, Feb 16, 2024, 2:47 PM Chuck Caldarale <n8...@gmail.com> wrote:

>
> > On Feb 16, 2024, at 11:31, Mark Thomas <ma...@apache.org> wrote:
> >
> > On 09/02/2024 13:47, Alex O'Ree wrote:
> >> I've been experimenting with tomcat 9.x in seeing how long i can get a
> web
> >> socket session to last. I'm currently struggling to get past 30 minutes
> or
> >> so. Looking for guidance on how to best increase this or if this is a
> bad
> >> idea.
> >> Here's the current configuration and what i've tried thus far:
> >> The server continuously streams messages the client, about 1 per second
> >> The client periodically (every 30 seconds) sends a keep alive text
> message
> >> back to the server
> >> The server side endpoint sets the Session.setTimeout(0); according to
> the
> >> docs, this should prevent timeouts
> >> The server side WAR file/WEB-INF/web.xml had a session timeout defined
> at
> >> 15 minutes but i then removed it in order to increase the websocket
> >> duration.
> >> Despite all this, both the client and server log a session disconnect,
> but
> >> i'm still not sure what the reasoning is. I'm still assuming it's some
> kind
> >> of timeout mechanism.
> >
> > I think you need to do a little more investigation with your
> application. I've been running the snake WebSocket example on 9.0.x for
> over any hour wihtout any issues.
>
>
> Are there any boxes (eg, load balancer, firewall) between the client and
> server that might be forcibly dropping TCP connections after 30 minutes?
>
>   - Chuck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Long lasting websocket sessions

Posted by "bigelytechnology@yahoo.com" <da...@gmail.com>.
 Hello Dear
Thanks for your reply
l would use this opportunity to briefly introduce our company, Bigly
Technologies Thailand,  We are one of the leading importers in Asia , and
the Middle East on general Goods and Equipment.
On behalf of Bigly Technologies Thailand, this is the samples of the
product that we want develop.
Please Kindly view our website for the samples and the product we need if
your company can
make the similar like this product.
*E-Catalogue:  *https://biglytechcatalog.es.tl

Please quote us your best prices and the cost of delivery to our port and
if the prices meets our
price target we can place our order as soon as possible.
Thank You!

Best Regards

*Wat Namtip*

Purchase Manager

*Bigly Technologies Thailand*

2/51 BangNa Complex Office Tower, 11th Floor, Soi BangNa Trat 25, Bangna
Nua, Bangna, Bangkok 10260 Thailand

Telephone: +66 (0)2150 10 15

On Sat, Feb 17, 2024 at 2:46 AM Chuck Caldarale <n8...@gmail.com> wrote:

>
> > On Feb 16, 2024, at 11:31, Mark Thomas <ma...@apache.org> wrote:
> >
> > On 09/02/2024 13:47, Alex O'Ree wrote:
> >> I've been experimenting with tomcat 9.x in seeing how long i can get a
> web
> >> socket session to last. I'm currently struggling to get past 30 minutes
> or
> >> so. Looking for guidance on how to best increase this or if this is a
> bad
> >> idea.
> >> Here's the current configuration and what i've tried thus far:
> >> The server continuously streams messages the client, about 1 per second
> >> The client periodically (every 30 seconds) sends a keep alive text
> message
> >> back to the server
> >> The server side endpoint sets the Session.setTimeout(0); according to
> the
> >> docs, this should prevent timeouts
> >> The server side WAR file/WEB-INF/web.xml had a session timeout defined
> at
> >> 15 minutes but i then removed it in order to increase the websocket
> >> duration.
> >> Despite all this, both the client and server log a session disconnect,
> but
> >> i'm still not sure what the reasoning is. I'm still assuming it's some
> kind
> >> of timeout mechanism.
> >
> > I think you need to do a little more investigation with your
> application. I've been running the snake WebSocket example on 9.0.x for
> over any hour wihtout any issues.
>
>
> Are there any boxes (eg, load balancer, firewall) between the client and
> server that might be forcibly dropping TCP connections after 30 minutes?
>
>   - Chuck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Long lasting websocket sessions

Posted by Chuck Caldarale <n8...@gmail.com>.
> On Feb 16, 2024, at 11:31, Mark Thomas <ma...@apache.org> wrote:
> 
> On 09/02/2024 13:47, Alex O'Ree wrote:
>> I've been experimenting with tomcat 9.x in seeing how long i can get a web
>> socket session to last. I'm currently struggling to get past 30 minutes or
>> so. Looking for guidance on how to best increase this or if this is a bad
>> idea.
>> Here's the current configuration and what i've tried thus far:
>> The server continuously streams messages the client, about 1 per second
>> The client periodically (every 30 seconds) sends a keep alive text message
>> back to the server
>> The server side endpoint sets the Session.setTimeout(0); according to the
>> docs, this should prevent timeouts
>> The server side WAR file/WEB-INF/web.xml had a session timeout defined at
>> 15 minutes but i then removed it in order to increase the websocket
>> duration.
>> Despite all this, both the client and server log a session disconnect, but
>> i'm still not sure what the reasoning is. I'm still assuming it's some kind
>> of timeout mechanism.
> 
> I think you need to do a little more investigation with your application. I've been running the snake WebSocket example on 9.0.x for over any hour wihtout any issues.


Are there any boxes (eg, load balancer, firewall) between the client and server that might be forcibly dropping TCP connections after 30 minutes?

  - Chuck


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


Re: Long lasting websocket sessions

Posted by Mark Thomas <ma...@apache.org>.
On 09/02/2024 13:47, Alex O'Ree wrote:
> I've been experimenting with tomcat 9.x in seeing how long i can get a web
> socket session to last. I'm currently struggling to get past 30 minutes or
> so. Looking for guidance on how to best increase this or if this is a bad
> idea.
> 
> Here's the current configuration and what i've tried thus far:
> 
> The server continuously streams messages the client, about 1 per second
> The client periodically (every 30 seconds) sends a keep alive text message
> back to the server
> The server side endpoint sets the Session.setTimeout(0); according to the
> docs, this should prevent timeouts
> The server side WAR file/WEB-INF/web.xml had a session timeout defined at
> 15 minutes but i then removed it in order to increase the websocket
> duration.
> 
> Despite all this, both the client and server log a session disconnect, but
> i'm still not sure what the reasoning is. I'm still assuming it's some kind
> of timeout mechanism.

I think you need to do a little more investigation with your 
application. I've been running the snake WebSocket example on 9.0.x for 
over any hour wihtout any issues.

Mark

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