VMWare Fusion and perl Bytes::Random::Secure via Apache mod_perl

I recently noticed that on my development machine some http/https requests running to a Debian guest on MacOS VMWare Fusion took muuuuch time and were  extremely slow … some requests took 30 secs. instead of few millisecs. The application on the Debian is written in perl and executed via Apache/mod_perl.

My first thoughts were NAT, networking, IPv6, … but not even close! A couple of print STDERR statements later I realized that calls to Bytes::Random::Secure (or underlying Crypt::Random::Seed) which use /dev/random or /dev/urandom caused it. Using just (unsecure) rand() fixed it.

I wonder why /dev/random or /dev/urandom is that slow on VMWare Fusion … this needs further research.