3 ms·
Funny anecdote: every time I cat /proc/sys/kernel/random/entropy_avail the value drops. It slowly rises when the usual entropy sources are used (mouse/keyboard/
by yuvadam 13y ago
Funny anecdote: every time I cat /proc/sys/kernel/random/entropy_avail the value drops. It slowly rises when the usual entropy sources are used (mouse/keyboard/IO).
Can anyone explain the consistent value drop when cat'ing?
- gizmo686 13y agoI can't explain your observations. On my machine, I tried cat`ting entropy_avail every .1s. My observation it that in consistently rises until it hits 190, when it instantly drops to around 140. The upper bound of 190 seems to be pretty consistent (very occasionally it drops earlier, it never seems to exceed 191), where the lower bound goes between 130 and 160. I'd assume this means that I'm low on entropy (especially because the post indicates that below 200 indicates that the system is running low), however I cannot think of anything special I am running that would be eating entropy. Also, mashing my keyboard and mouse does not seem to affect the rate of entropy accumulation. Decreasing my sample rate also does not seem to slow down the rate of accumulation, so it looks like cat`ing does not affect the value on my machine.
- js2 13y agoMaybe correlation is not causation here? Something else is using entropy faster than it's being replenished? I wonder if there's a way to see what's consuming entropy? Maybe lsof on /dev/random.
- DanBC 13y agoThat interesting question was asked on Stack Overflow, and closed as off topic. (http://stackoverflow.com/questions/13170334/reading-entropy-avail-file-appears-to-consume-entropy http://stackoverflow.com/questions/13170334/reading-entropy-...) A comment says that cat is consuming the entropy, not reading the file. An answer links to (https://blog.flameeyes.eu/2011/03/entropy-broken https://blog.flameeyes.eu/2011/03/entropy-broken) which says "starting a process consumes entropy" but otherwise didn't seem to have an answer. (But I only skimmed.) This thread (http://www.standalone-sysadmin.com/blog/2013/07/monitoring-entropy-but-but-but/ http://www.standalone-sysadmin.com/blog/2013/07/monitoring-e...) says that you're just using cat while entropy is being used, and if you keep using cat you see the numbers go down and up.