I've noticed that since updating my server to Debian Squeeze the amount of entropy as reported by /proc/sys/kernel/random/entropy_avail is much lower than it was before the upgrade. I would like to know if this lower pool size is big enough to function with or if I need to look into getting more entropy sources. I think having a way to log blocking reads of /dev/random would show whether I have enough entropy or not.

  • Are you sure you are short on entropy? I just checked my Debian Squeeze box and it seemed to have about the same entropy value as a CentOS box. Numbers varied from 160 to 190. – Alex Feb 8 '11 at 1:29
  • Munin's logs show a clear drop after updating to Squeeze that hasn't recovered even with normal traffic. – ldrg Feb 8 '11 at 1:35
  • As for the "is that short": that's the reason why I want to log blocking: if reads are blocking I am short. – ldrg Feb 8 '11 at 1:36
  • Just a suggestion: use /dev/urandom if it exists. Urandom doesn't block. – JeffG Mar 21 '11 at 20:15
  • Try rng-tools (.deb package) – Natmaka Mar 25 '11 at 16:30

You can write a library with your own implementation of read(...) or whatever function you use to read from /dev/random to wrap the actual call in profiling and logging methods. Then you should use a LD_PRELOAD env variable to insert your custom implementation of read before the system one.

  • It will not work for a statically-linked binary (granted: they are pretty rare nowadays). – Natmaka Mar 25 '11 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.