[Libwebsockets] libwebsockets-test-server-pthreads only runs one thread

Andrew Purkis andrew.purkis at versaterm.com
Mon Jun 13 23:11:50 CEST 2016


Thanks for the reply.

Didn't realize it was that recent.

You're right, we probably don't need multi-threading, just wanted to see 
the difference under various loads.

Thanks
Andrew Purkis

On 2016-06-09 6:54 PM, Andy Green wrote:
>
> On June 10, 2016 2:50:08 AM GMT+08:00, Andrew Purkis <andrew.purkis at versaterm.com> wrote:
>> Hi,
>>
>>
>>
>> I'm kinda new to libwebsockets, and have run into a problem with the
>> test
>> servers.
>>
>>
>>
>> I'm running on a Redhat-6.4 64-bit machine, using Libwebsockets
>> version:
>> 2.0-stable
>>
>>
>>
>> If I run  ' libwebsockets-test-server-pthreads', I get :
>>
>>
>>
>> lwsts[24642]: libwebsockets test server pthreads - license LGPL2.1+SLE
>>
>> lwsts[24642]: (C) Copyright 2010-2016 Andy Green <andy at warmcat.com>
>>
>> Using resource path "/usr/local/share/libwebsockets-test-server"
>>
>> lwsts[24642]: Initial logging level 7
>>
>> lwsts[24642]: Libwebsockets version: 2.0.0 andrew at cad74ajp-
>>
>> lwsts[24642]: IPV6 not compiled in
>>
>> lwsts[24642]: libev support not compiled in
>>
>> lwsts[24642]: libuv support not compiled in
>>
>> lwsts[24642]:  Threads: 1 each 32768 fds
>>
>> lwsts[24642]:  mem: platform fd map: 262144 bytes
>>
>> lwsts[24642]:  Compiled with OpenSSL support
>>
>> lwsts[24642]:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
>>
>> lwsts[24642]: Creating Vhost 'default' port 7681, 3 protocols
>>
>> lwsts[24642]:  Listening on port 7681
>>
>> lwsts[24642]:  mem: per-conn:          488 bytes + protocol rx buf
>>
>> lwsts[24642]:  canonical_hostname = cad74ajp.versaterm.com
>>
>> lwsts[24642]: lws_protocol_init
>>
>>
>>
>> however if I run ' libwebsockets-test-server-pthreads - j2', I get:
>>
>>
>>
>> lwsts[25204]: libwebsockets test server pthreads - license LGPL2.1+SLE
>>
>> lwsts[25204]: (C) Copyright 2010-2016 Andy Green <andy at warmcat.com>
>>
>> Using resource path "/usr/local/share/libwebsockets-test-server"
>>
>> lwsts[25204]: Initial logging level 7
>>
>> lwsts[25204]: Libwebsockets version: 2.0.0 andrew at cad74ajp-
>>
>> lwsts[25204]: IPV6 not compiled in
>>
>> lwsts[25204]: libev support not compiled in
>>
>> lwsts[25204]: libuv support not compiled in
>>
>> lwsts[25204]:  Threads: 2 each 16384 fds
>>
>> lwsts[25204]:  mem: platform fd map: 262144 bytes
>>
>> lwsts[25204]:  Compiled with OpenSSL support
>>
>> lwsts[25204]:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
>>
>> lwsts[25204]: Creating Vhost 'default' port 7681, 3 protocols
>>
>> lwsts[25204]: ERROR on binding fd 10 to port 7681 (-1 98)
> Multiple service threads relies on a Linux-specific socket option SO_REUSEPORT.
>
> The problem you're having is the RH 6.4 kernel is a 2.6 one from ~5 years ago, that predates the introduction of that socket option.
>
> Multiple service threads only provide some benefit if there's a heavy cpu load in the user code somewhere anyway, in most cases there is no advantage to it.
>
> -Andy
>
>> lwsts[25204]: Failed to create default vhost
>>
>> lwsts[25204]: libwebsocket init failed
>>
>>
>>
>> Any ideas as to why this is happening?
>>
>>
>>
>> Thanks
>>
>> Andrew Purkis
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
>> http://libwebsockets.org/mailman/listinfo/libwebsockets
> .
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20160613/6a08ebbe/attachment-0001.html>


More information about the Libwebsockets mailing list