Skip to content

Docs: Mention that fqdn_rand accepts strings as seed additions #2005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2013

Conversation

nfagerlund
Copy link
Contributor

No description provided.

zaphod42 added a commit that referenced this pull request Oct 21, 2013
Docs: Mention that fqdn_rand accepts strings as seed additions
@zaphod42 zaphod42 merged commit 94316e8 into puppetlabs:master Oct 21, 2013
@slippycheeze
Copy link
Contributor

I only just noticed this; that change is technically accurate, but I completely fail to understand what the purpose of the arguments is, or why you would supply it. (...and I understand how a PRNG would be implemented, putting me one up on the readers that this is most important for, I suspect. :)

Would it be possible to augment this with something that explained what that did, and when to use it?

For example, something akin to:

The second argument is a string, which is mixed into the random number seed. This is most often useful to identify the "purpose" of the call, if you use it multiple times for scheduling jobs, so that you don't get a thundering herd of processes starting at the same time -- because the number is unpredictable but identical on each call otherwise.

An example of uses would be:
fqdn_rand(30, "update packages")
fqdn_rand(30, "background fsck")

This helps to schedule your package updates and your background fsck operation at different times on the same machine, while still keeping their timing stable.

(I think those are terrible examples of the sort of jobs that might benefit from this, but I can't think of anything better off-hand.)

@nfagerlund
Copy link
Contributor Author

Wow, that would be excellent. Does anyone have better examples of the types of jobs one would use this for, or is Daniel being self-deprecating again and those are actually fine? :)

@slippycheeze
Copy link
Contributor

Wow, that would be excellent. Does anyone have better examples of the types of jobs one would use this for, or is Daniel being self-deprecating again and those are actually fine? :)

They are relatively abstract / advanced jobs, which wouldn't be
familiar to most sysadmins or most systems. Unfortunately, I couldn't
think of examples that would fit the bill; I wanted:

  • something that isn't part of the core OS, but that you schedule yourself
  • something that is "costly" in some way
  • two of them

It might actually make sense to use "run the puppet agent" as one of
them -- most people know that is potentially expensive, and it isn't
scheduled by the OS by default. (OTOH, do we recommend cron for
running the agent these days? Maybe it isn't great after all.)

Something like "RAID disk checking" might make sense, or it might not,
depending on the users.

I guess, really, it doesn't matter that much what the examples are,
and you could call them "expensive job one" and "expensive job two" or
something if you wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants