Comment on Tarsnap performance issues in late March, most of AprilparentComments−sillysaurus311yI have to know: Why a hash function of the hostname?−pliu11yThe chef-client cookbook does a similar thing in its cron recipe: # Generate a uniformly distributed unique number to sleep. if node['chef_client']['splay'].to_i > 0 checksum = Digest::MD5.hexdigest(node['fqdn'] || 'unknown-hostname') sleep_time = checksum.to_s.hex % node['chef_client']['splay'].to_i else sleep_time = nil end https://github.com/opscode-cookbooks/chef-client/blob/master...This is random enough so you won't kill the server, and deterministic so the resource isn't always changing every Chef run.−toomuchtodo11yNo hash collisions, hostnames (in almost all practical environments) are never identical.−jldugger11yIt's more or less random, but stable.
Comments
I have to know: Why a hash function of the hostname?
The chef-client cookbook does a similar thing in its cron recipe:
https://github.com/opscode-cookbooks/chef-client/blob/master...This is random enough so you won't kill the server, and deterministic so the resource isn't always changing every Chef run.
No hash collisions, hostnames (in almost all practical environments) are never identical.
It's more or less random, but stable.