#37840 [NEW]: uniqid() without more_entropy extremely slow

From: Date: Sun, 18 Jun 2006 17:21:08 +0000
Subject: #37840 [NEW]: uniqid() without more_entropy extremely slow
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98452@lists.php.net to get a copy of this message
From: diego at caravana dot to Operating system: Linux 2.4.21 PHP version: 5.1.4 PHP Bug Type: Performance problem Bug description: uniqid() without more_entropy extremely slow Description: ------------ See #37106 first. Ok, this may be "bogus", but is there a workaround or some other unique id generator in PHP? I've spent 2 days trying to figure out why my webapp was *so slow* on production server, when on develop/test environments it was acceptable... At last, I profiled (APD) it and discovered that uniqid() was terribly slow. I searched for some big problem in my app then, without any other clue, I commented out the usleep() call in uniqid.c: magically, a page that took 10 seconds now responded under 1 sec! I tried with the following lines instead of usleep(), but with the same problem: struct timespec tsq; tsq.tv_sec = 0; tsq.tv_nsec = 1; nanosleep(&tsq, NULL); FYI, I "patched" PHP 5.1.4, and the server with the problem runs an updated RHEL 3 (Linux 2.4.21-40.ELsmp). -- Edit bug report at http://bugs.php.net/?id=37840&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37840&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37840&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37840&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37840&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37840&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37840&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37840&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37840&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37840&r=support Expected behavior: http://bugs.php.net/fix.php?id=37840&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37840&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37840&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37840&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37840&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37840&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37840&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37840&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37840&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37840&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37840&r=mysqlcfg

« previous php.bugs (#98452) next »