[issue18756] os.urandom() fails under high load

Antoine Pitrou report at bugs.python.org
Fri Aug 16 18:43:45 CEST 2013


Antoine Pitrou added the comment:

> > Well, even with greenlets, I assume you're using at least one FD
> (socket) per client, no?
> > So you can get EMFILE on socket() just as on os.urandom(). 
> 
> I do many calls on urandom() so that's the FD bottleneck.

Unless you're doing many calls *in parallel* it's unlikely to be a
bottleneck.
At worse you can write your own /dev/urandom reading code, with a shared
fd amongst all your threads / greenlets.

os.urandom() is a convenience function, it doesn't have to be extremely
optimized.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18756>
_______________________________________


More information about the Python-bugs-list mailing list