Why Unix domain takes so many buffer for small package
<p>I have doing some unix domain and tcp/ip client/server test and find out 
the unix domain takes much more buffer than it really supposed to be,
both of them are using SOCK_STREAM .</p>

<p>In 3.10.0-327.el7.x86_64 linux ,  the unix domain client connect to unix domain server and the unix domain server send 44 bytes packages to client every 10 seconds ,  client  never call recv  so that all packages sent from server will
be all jammed in buffer , the following is what I observed :</p>

<pre><code>ss -ax |grep "test"

Netid  State      Recv-Q Send-Q                                    Local Address:Port                                                     Peer Address:Port

u_str  ESTAB      0      768    /tmp/testud 22461998              * 22461997  
u_str  ESTAB      0      1536   /tmp/testud 22461998              * 22461997 
u_str  ESTAB      0      2304   /tmp/testud 22461998              * 22461997 
</code></pre>

<p>I am doing the same test in tcp/ip  , as the following showes :</p>

<pre><code>ss -at | grep "192.168"

State      Recv-Q Send-Q Local Address:Port                 Peer Address:Port  
ESTAB      44     0      192.168.2.1:odnsp                192.168.2.2:distinct 
ESTAB      88     0      192.168.2.1:odnsp                192.168.2.2:distinct
ESTAB      132    0      192.168.2.1:odnsp                192.168.2.2:distinct 
</code></pre>

<p>As you see , the unix domain Send-Q  has 768 bytes , but the actual packages only cost 44 bytes ,  and the tcp/ip Recv-Q takes  44 bytes for each package exactly .</p>

<p>My question is why send 44 bytes packages through SOCK_STREAM , the unix domain buffer cost 768 bytes each but tcp/ip buffer cost only 44 bytes ?!</p>