[Libwebsockets] count_threads in client side

Peiffer Eric eric.peiffer at al-enterprise.com
Thu Oct 22 17:44:26 CEST 2020


My application use libwebsockets 4.1 on debian 10 and handle thousands of web socket connections.
We have notice that when we approach the 15000 connections de thread that run the message loop take almost 100%  of the CPU.
This is because client connections receive xmpp ping each minute, not in the same time but may be 1000 connexions receive xmpp ping then 1 second later the next 2000, and so on ,...

In order to decrease the CPU usage is it possible to use a pool of several threads maybe 2 or 3 in order to handle the 15000 client connections. Can I use the count_threads paramaters in the info struct in order to handle more than one thread in the context that handle client connections?
If the answer is yes how are managed the connections:
When a connection is opened does it always stay in the same thread?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20201022/f4c67aaf/attachment.htm>

More information about the Libwebsockets mailing list