Battling Low System Entropy

Having a sufficient pool of system entropy is really important for the /dev/random and /dev/urandom devices to operate properly. Even if you do not explicitly request random bytes, you would still need them to function as expected, since they are being used as a source of randomness for TLS connections.

For example, if you are using Docker, you may get random hangs when executing simple commands when the system entropy pool has been drained.

In order to deal with this issue, you could install rng-tools or haveged. These install a service that keeps running in the background and gathers entropy from random operating system events. On Ubuntu, you can easily install with:

$ sudo apt-get install rng-tools haveged
$ sudo systemctl restart rng-tools