title: How to monitor Linux UDP buffer available space?
body: <p>I have a java app on linux which opens UDP socket and waits for messages.</p>
  
  <p>After couple of hours under heavy load, there is a packet loss, i.e. the packets are received by kernel but not by my app (we see the lost packets in sniffer, we see UDP packets lost in netstat, we don't see those packets in our app logs).</p>
  
  <p>We tried enlarging socket buffers but this didnt help - we started losing packets later then before, but that's it.</p>
  
  <p>For debugging, I want to know how full the OS udp buffer is, at any given moment. Googled, but didn't find anything. Can you help me?</p>
  
  <p>P.S. Guys, I'm aware that UDP is unreliable. However - my computer receives all UDP messages, while my app is unable to consume some of them. I want to optimize my app to the max, that's the reason for the question. Thanks. </p>