The speed at which you can call a Linux RNG (Random Number Generator) source before it starts repeating outputs depends on several factors, including the entropy source, the RNG implementation, and the system's configuration. Here's a breakdown:
1. Linux RNG Sources
/dev/random (blocking): Waits for sufficient entropy from hardware sources (e.g., keyboard, mouse, disk I/O, interrupts). It is slow but cryptographically secure.
/dev/urandom (non-blocking): Does not block and uses an internal CSPRNG (Cryptographically Secure Pseudorandom Number Generator) seeded by /dev/random. It is faster and still secure for most purposes.
getrandom() syscall: Prefers /dev/urandom by default but can block if the CSPRNG is not yet initialized.
2. Output Repetition
The Linux kernel's CSPRNG (used by /dev/urandom and getrandom()) is designed to never repeat outputs under normal conditions. It is periodically reseeded with fresh entropy.
The theoretical period of the CSPRNG is extremely large (e.g., ChaCha20, used in newer kernels, has a period of (2^{64}) for a single key, but the kernel reseeds frequently).
If you exhaust the entropy pool (e.g., by generating numbers faster than the system can gather entropy), /dev/random will block, but /dev/urandom will continue without blocking (though its security depends on the initial seed).
3. Practical Limits
Speed: You can call /dev/urandom or getrandom() at very high speeds (millions of calls per second on modern hardware) without repetition.
Entropy Depletion: If you use /dev/random and exhaust the entropy pool, it will block until more entropy is available, slowing you down.
Reseeding: The kernel reseeds the CSPRNG periodically (e.g., every 5 minutes or after generating 1MB of data), ensuring fresh entropy.
On a modern system, this can achieve hundreds of MB/s (e.g., 500 MB/s or more), meaning billions of random numbers per second.
5. Theoretical Repetition
The chance of repetition is negligible for practical purposes (e.g., for a 128-bit random number, the probability of collision is (2^{-64}) after (2^{64}) calls, which is astronomically low).
If you somehow generated numbers faster than the reseeding rate and exhausted the internal state, the CSPRNG would still not repeat due to its design.
Conclusion
You can call /dev/urandom or getrandom() at speeds of hundreds of MB/s (billions of calls per second) without meaningful risk of repetition. The Linux CSPRNG is designed to avoid repetition indefinitely, even under heavy load. Only /dev/random will slow down due to blocking, but it is rarely used for high-throughput applications.
For most practical purposes, you will never hit repetition in the Linux RNG.