[Libwebsockets] Setting up a high-throughput libwebsockets server.

Chris Evans chris.evans at adroll.com
Mon Oct 3 23:22:27 CEST 2016


Howdy,

I'm looking to set up a simple query/response websockets-protocol server in
a high-throughput environment: Serving a machine learning model behind
Amazon's new Application Load Balancer (which necessitates speaking the
WebSockets protocol) . `libwebsockets` seems a good choice as 1) I'm not
looking to build a full web app, and 2) It doesn't allocate per query (is
that correct?)

But I've run into issues when stress testing with the `tcpkali` tool (
https://github.com/machinezone/tcpkali), even against the provided
test-echo server; `tcpkali` is unable to make a connection (I've had
success with tcpkali in other contexts):

```

chrisevans at CHRIS-EVANS:bin ((detached from v2.0.0))$
./libwebsockets-test-echo --port 6666

[2016/09/03 13:44:51:3543] NOTICE: Built to support client operations

[2016/09/03 13:44:51:3543] NOTICE: Built to support server operations

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: libwebsockets test
server echo - license LGPL2.1+SLE

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: (C) Copyright 2010-2016
Andy Green <andy at warmcat.com>

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: Running in server mode

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: Initial logging level 7

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: Libwebsockets version:
2.0.0 chrisevans at CHRIS-EVANS-v2.0.0

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: IPV6 not compiled in

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: libev support not
compiled in

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: libuv support not
compiled in

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  Threads: 1 each 10240
fds

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  mem: platform fd map:
81920 bytes

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  Compiled with OpenSSL
support

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  SSL disabled: no
LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>: Creating Vhost 'default'
port 6666, 1 protocols

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  Listening on port 6666

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  mem: per-conn:
488 bytes + protocol rx buf

Oct  3 13:44:51 CHRIS-EVANS lwsts[14575] <Notice>:  canonical_hostname =
CHRIS-EVANS
```

```

chrisevans at CHRIS-EVANS:Clients (test_suite)$ tcpkali -m "Test Message" -c 1
--ws  127.0.0.1:6666

Destination: [127.0.0.1]:6666

Interface lo0 address [127.0.0.1]:0

Interface lo0 address [169.254.169.254]:0

Using interface lo0 to connect to [127.0.0.1]:6666

Could not create 1 connection in allotted time (10s)

```

Any help would be greatly appreciated!

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20161003/b46d80c1/attachment.html>


More information about the Libwebsockets mailing list