<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="IT" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">i’m using libwebsockets 3.2.2 under Raspbian stretch.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Using command ss -tm (</span><a href="https://www.man7.org/linux/man-pages/man8/ss.8.html"><span lang="EN-GB">https://www.man7.org/linux/man-pages//man8/ss.8.html</span></a><span lang="EN-GB">) I can see the memory settings
 of my websockets:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">The output format is:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">              skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                            f<fwd_alloc>,w<wmem_queued>,o<opt_mem>,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                            bl<back_log>,d<sock_drop>)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">              </span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><rmem_alloc></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the memory allocated for receiving packet<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><rcv_buf></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the total memory can be allocated for receiving packet<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><wmem_alloc></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the memory used for sending packet (which has been sent<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     to layer 3)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><snd_buf></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the total memory can be allocated for sending packet<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><fwd_alloc></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the memory allocated by the socket as cache, but not<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     used for receiving/sending packet yet. If need memory<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     to send/receive packet, the memory in this cache will<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     be used before allocate additional memory.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><wmem_queued></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     The memory allocated for sending packet (which has not<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     been sent to layer 3)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><ropt_mem></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     The memory used for storing socket option, e.g., the<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     key for TCP MD5 signature<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><back_log></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     The memory used for the sk backlog queue. On a process<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     context, if the process is receiving packet, and a new<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     packet is received, it will be put into the sk backlog<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     queue, so it can be received by the process immediately<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">             
</span><b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:#502000;mso-fareast-language:IT"><sock_drop></span></b><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     the number of packets dropped before they are de-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;font-family:"Courier New";color:black;mso-fareast-language:IT">                     multiplexed into the socket<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">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? <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Alessandro<o:p></o:p></span></p>
</div>
</body>
</html>