[Libwebsockets] clarification on struc lws_protocols

Alessandro Longobardi alessandro.longobardi at vrmedia.it
Thu Jun 4 14:47:04 CEST 2020


Hi,
i'm using libwebsockets 3.2.2 under Raspbian stretch.
Using command ss -tm (https://www.man7.org/linux/man-pages//man8/ss.8.html<https://www.man7.org/linux/man-pages/man8/ss.8.html>) I can see the memory settings of my websockets:
The output format is:

              skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,
                            f<fwd_alloc>,w<wmem_queued>,o<opt_mem>,
                            bl<back_log>,d<sock_drop>)

              <rmem_alloc>
                     the memory allocated for receiving packet

              <rcv_buf>
                     the total memory can be allocated for receiving packet

              <wmem_alloc>
                     the memory used for sending packet (which has been sent
                     to layer 3)

              <snd_buf>
                     the total memory can be allocated for sending packet

              <fwd_alloc>
                     the memory allocated by the socket as cache, but not
                     used for receiving/sending packet yet. If need memory
                     to send/receive packet, the memory in this cache will
                     be used before allocate additional memory.

              <wmem_queued>
                     The memory allocated for sending packet (which has not
                     been sent to layer 3)

              <ropt_mem>
                     The memory used for storing socket option, e.g., the
                     key for TCP MD5 signature

              <back_log>
                     The memory used for the sk backlog queue. On a process
                     context, if the process is receiving packet, and a new
                     packet is received, it will be put into the sk backlog
                     queue, so it can be received by the process immediately

              <sock_drop>
                     the number of packets dropped before they are de-
                     multiplexed into the socket


I have the following question: why if I change the value of rx_buffer_size of struc lws_protocols, and then is use command ss -tm in  memory stat the <snd_buf> is affected by rx_buffer_size? I'm expecting that tx_buffer_size affects <snd_buf> ...am I wrong?
Thank you,
Alessandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200604/b5fbd41e/attachment.htm>


More information about the Libwebsockets mailing list