Message195338
I have seen complains from e.g. Tarek that os.urandom() fails under high load: https://twitter.com/tarek_ziade/status/362281268215418880
The problem is caused by file descriptor limits. os.urandom() opens /dev/urandom for every call. How about os.urandom() uses a persistent file descriptor? That should eliminate the error. It may alsos speed up os.urandom() because a persistent FD gets rid of open() and close() syscalls.
* open /dev/urandom on first call of os.urandom() and store the fd in a static var
* invalidate, close fd on read() -> EINVAL; open /dev/urandom again
* close fd when interpreter shuts down |
|
Date |
User |
Action |
Args |
2013-08-16 15:21:38 | christian.heimes | set | recipients:
+ christian.heimes, vstinner, tarek, hynek |
2013-08-16 15:21:38 | christian.heimes | set | messageid: <1376666498.06.0.618743202178.issue18756@psf.upfronthosting.co.za> |
2013-08-16 15:21:38 | christian.heimes | link | issue18756 messages |
2013-08-16 15:21:37 | christian.heimes | create | |
|