Class RandomEntropyManager

java.lang.Object
com.aoindustries.aoserv.daemon.random.RandomEntropyManager
All Implemented Interfaces:
Runnable

public final class RandomEntropyManager extends Object implements Runnable
Watches the amount of entropy available in the system, obtains entropy from the master when running low, provides entropy to the master when has extra.
Author:
AO Industries, Inc.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The number of bits available after providing to the master server.
    static final long
    The delay after an error occurs.
    static final long
    The minimum interval between calls to getMasterEntropyNeeded().
    static final int
    The number of bits below which haveged will be automatically installed.
    static final long
    The maximum delay between scans when at the desired entropy.
    static final long
    The maximum delay between scans when obtaining from the master.
    static final long
    The delay when obtaining from the master is incomplete (master out of entropy).
    static final long
    The minimum delay between scans.
    static final int
    The number of bits available where will obtain from master server when haveged is not supported or is not currently installed.
    static final int
    The number of bits available where will obtain from master server when haveged is supported and installed.
    static final int
    The number of bits available where will provide to master server.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
     
    static void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_DELAY

      public static final long MIN_DELAY
      The minimum delay between scans.
      See Also:
    • MAX_OBTAIN_DELAY

      public static final long MAX_OBTAIN_DELAY
      The maximum delay between scans when obtaining from the master.
      See Also:
    • MAX_OBTAIN_INCOMPLETE_DELAY

      public static final long MAX_OBTAIN_INCOMPLETE_DELAY
      The delay when obtaining from the master is incomplete (master out of entropy). This is used to avoid hitting the master stupid-hard when it is depleted.
      See Also:
    • MAX_DESIRED_DELAY

      public static final long MAX_DESIRED_DELAY
      The maximum delay between scans when at the desired entropy.
      See Also:
    • GET_MASTER_ENTROPY_NEEDED_INTERVAL

      public static final long GET_MASTER_ENTROPY_NEEDED_INTERVAL
      The minimum interval between calls to getMasterEntropyNeeded().
      See Also:
    • ERROR_DELAY

      public static final long ERROR_DELAY
      The delay after an error occurs.
      See Also:
    • PROVIDE_THRESHOLD

      public static final int PROVIDE_THRESHOLD
      The number of bits available where will provide to master server.

      This is scaled from an expected pool size of 4096. See /proc/sys/kernel/random/poolsize

      See Also:
    • DESIRED_BITS

      public static final int DESIRED_BITS
      The number of bits available after providing to the master server.

      This is scaled from an expected pool size of 4096. See /proc/sys/kernel/random/poolsize

      See Also:
    • OBTAIN_THRESHOLD_NO_HAVEGED

      public static final int OBTAIN_THRESHOLD_NO_HAVEGED
      The number of bits available where will obtain from master server when haveged is not supported or is not currently installed.

      This is scaled from an expected pool size of 4096. See /proc/sys/kernel/random/poolsize

      See Also:
    • HAVEGED_THRESHOLD

      public static final int HAVEGED_THRESHOLD
      The number of bits below which haveged will be automatically installed. This is an attempt to keep the system non-blocking with good entropy.

      This matches the default number of bits where haveged kicks-in (-w 1024).

      See Also:
    • OBTAIN_THRESHOLD_WITH_HAVEGED

      public static final int OBTAIN_THRESHOLD_WITH_HAVEGED
      The number of bits available where will obtain from master server when haveged is supported and installed. We try to let haveged take care of things before pulling from the master.

      This is scaled from an expected pool size of 4096. See /proc/sys/kernel/random/poolsize

      See Also:
  • Method Details