Fleck icon indicating copy to clipboard operation
Fleck copied to clipboard

Server side queue limit

Open RenaudGelai opened this issue 5 years ago • 15 comments

#265

RenaudGelai avatar Jul 09 '19 10:07 RenaudGelai

:white_check_mark: Build Fleck 0.0.43-ci completed (commit https://github.com/statianzo/Fleck/commit/4240f14f6a by @)

AppVeyorBot avatar Jul 09 '19 10:07 AppVeyorBot

:white_check_mark: Build Fleck 0.0.43-ci completed (commit https://github.com/statianzo/Fleck/commit/4240f14f6a by @)

AppVeyorBot avatar Jul 09 '19 10:07 AppVeyorBot

I implemented it so that it doesn't alter the current behavior without explicitly specifying it, this way, people can simply update without worrying.

RenaudGelai avatar Jul 15 '19 16:07 RenaudGelai

I implemented it so that it doesn't alter the current behavior without explicitly specifying it, this way, people can simply update without worrying.

I'll release it as a major version bump to indicate possible breaking behavior.

statianzo avatar Jul 15 '19 19:07 statianzo

So, you want me to change to a default 5Mb limit ?

RenaudGelai avatar Jul 16 '19 09:07 RenaudGelai

:white_check_mark: Build Fleck 0.0.44-ci completed (commit https://github.com/statianzo/Fleck/commit/6dbf9fd87b by @)

AppVeyorBot avatar Jul 16 '19 09:07 AppVeyorBot

:white_check_mark: Build Fleck 0.0.44-ci completed (commit https://github.com/statianzo/Fleck/commit/6dbf9fd87b by @)

AppVeyorBot avatar Jul 16 '19 09:07 AppVeyorBot

I know I'm pretty late here, but I would rather using a BlockingCollection than throwing away the messages in this case.

darkl avatar Aug 09 '19 14:08 darkl

I know I'm pretty late here, but I would rather using a BlockingCollection than throwing away the messages in this case.

That would allow slow clients to use up the threadpool, giving the same resource exhaustion issue Fleck has (#265), just with threads instead of memory.

statianzo avatar Aug 09 '19 15:08 statianzo

I know I'm pretty late here, but I would rather using a BlockingCollection than throwing away the messages in this case.

It's not throwing away the messages, it's closing the connexion because the client can't keep up, it's a pretty common mechanism in network communications.

RenaudGelai avatar Aug 11 '19 01:08 RenaudGelai

Any news on this being merged?

Muny avatar Oct 24 '19 00:10 Muny

Just to let you know, i forked and deployed this in production, it works well, and i don't have memory issues anymore.

RenaudGelai avatar Oct 24 '19 08:10 RenaudGelai

Thanks for the update Renaud.

I tried this, but unfortunately it doesn't work for my application. I'm still narrowing down the issue I'm having, but so far it seems that when clients using smartphones connect to my Fleck server, then leave the web page (without closing it) the connection is left open. This is expected. However, the connection never seems to close, even when the device goes offline. This makes the messages the server sends (every 10ms or so) pile up and significantly increase memory usage.

Muny avatar Oct 24 '19 12:10 Muny

You used the code i changed in the PR ?

RenaudGelai avatar Oct 24 '19 12:10 RenaudGelai

You used the code i changed in the PR ?

Yes. I solved the problem by enforcing a heartbeat to be sent by the client. If the client stops sending heartbeats, the server closes the connection.

Muny avatar Oct 26 '19 06:10 Muny