Skip to main content

Low Entropy Situations for /dev/random.

  • November 27, 2021
  • 0 replies
  • 77 views

AkshayJadhav
StreamSets Employee
Forum|alt.badge.img

There are times when systems, particularly VMs, may run low on "entropy".   This situation may cause /dev/random to become slow or to block. /dev/random is used to generate UUIDs and some Origins and Destinations use random data as well, so slowing or blocking will definitely cause pipeline performance issues. 

We have some recommendations for Data Collector regarding low entropy situations. 

First, from the ask.streamsets.com site: https://ask.streamsets.com/question/2440/why-is-uuid-generation-so-slow/ we have the following suggestion:

 

Another simpler workaround is to set the entropy source to be /dev/urandom (instead of the default, which is /dev/random). Be aware this may have security implications for your application. To do this, set the following JVM property for your Data Collector process: -Djava.security.egd=file:/dev/urandom

This approach is easy to implement - but this may not be the best solution, as a primary difference between /dev/random and /dev/urandom, as previously mentioned - urandom will not block in low-entropy situations.  On the other hand, it may also return pseudo-random numbers, which is the "security implication" referred to in the quote above.  If this is not a problem in your use case, perhaps you're only generating UUID's - then this solution is (probably) fine. 

Also, from the documentation for Data Collector - there is a suggestion to use an "entropy generator" such as Haveged - link: 
http://issihosts.com/haveged/
and there are some installation and testing instructions for haveged here:
https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged

This is a more secure solution but has more setup and maintenance.

Did this topic help you find an answer to your question?
This topic has been closed for comments