Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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
show 1 more comment

1 Answer

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.

share|improve this answer
    
It will not work for a statically-linked binary (granted: they are pretty rare nowadays). –  Natmaka Mar 25 '11 at 16:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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