MacOS 2.1.2 client creating too many threads?
Hi, I have observed situations when the server has issues allowing connections (either takes too long or maxing out), the MacOS client would try to reconnect repeatedly and eventually spawned up hundreds of threads, spiking up the CPU and bringing the app to a halt. Is there best practices/connection options to avoid this? We are using standard configurations/options with only these customizations:
self.client.connectionOptions.maxBandwidth= @"100";
_subscription= [[LSSubscription alloc] initWithSubscriptionMode:@"DISTINCT" items:_itemNames fields:_fieldNames];
_subscription.dataAdapter= @"IL_DEFAULT";
_subscription.requestedSnapshot= @"no";
_subscription.requestedMaxFrequency= @"unlimited";
We don't have server 6.1 yet so we can't use websocket.
This issue has been resolved
After debugging, it turns out we have to disconnect explicitly everything we deallocate a lightstreamer client.
Quote:
Originally Posted by
gianluca.bertani
As far as we can see, when in a continuous reconnection loop the client keeps the number of threads limited. To better understand the conditions under which your problem occurs, I kindly ask you to replicate it with
client logging enabled.
You can enable logging by adding the following line:
[LSLightstreamerClient setLoggerProvider:[[LSConsoleLoggerProvider alloc] initWithLevel:LSConsoleLogLevelDebug]];
Once you have collected it, please send it to
support@lightstreamer.com.
Thank you.