ID:               31332
 Comment by:       gik at zap dot cl
 Reported By:      marekm at apnet dot pl
 Status:           Verified
 Bug Type:         Performance problem
 Operating System: *
 PHP Version:      4CVS, 5CVS (2005-01-04)
 New Comment:

As far as I know, objects stored in shared memory using shm_put_var()
are stored serialized.  I haven't looked at the  sources yet, but the
problem affecting unserialize() should also degrade the performance of
shm_put_var() which is vastly used to store arrays or other objects in
shared memory for _quick_ access.  I don't know if there are other
functions which use this method internally.

I wouldn't call it an abuse to serialize and store an array with 1000
elements in shm, as this is a very efficient way to do data caching. 
The performance degradation is large enough to make a web server
collapse, because of the extra time required to process each request.


Previous Comments:
------------------------------------------------------------------------

[2005-01-14 09:05:51] [EMAIL PROTECTED]

Sorry to say... but abusing serialize for this is not a good idea in
the first place. It's not meant for storing data in this way in the
first place. But of course the slowdown shouldn't have been this much.

------------------------------------------------------------------------

[2005-01-13 21:11:06] gik at zap dot cl

The excessively high load average of a server recently updated to php
4.3.10 was driving me nuts.  This bug is critical for many php based
systems as drupal, vBulletin and others.

Gik.

------------------------------------------------------------------------

[2005-01-10 13:43:52] kier at vbulletin dot com

I can confirm this problem from my experience with 4.3.10 and 5.0.3.

Unserialize() under the latest versions appears to be massively slower
than was previously so.

We have had wide reports of vBulletin installations running
significantly slower since we recommended that customers upgrade to
4.3.10 / 5.0.3.

Hoping for a quick resolution to this problem, as it affects so many
people so drastically.

------------------------------------------------------------------------

[2005-01-09 15:11:39] ralf dot praschak at gmx dot net

i use vbulletin 3.0.5. the forumcache is also unserialized.
i tracked this with the nusphere profiler.

with php 4.3.9 (or 5.0.2) it takes around 300ms.
with php 4.3.10 (or 5.0.3) it takes 17s and more !!!

the cache is around 2.5 megs big ;(

------------------------------------------------------------------------

[2004-12-30 10:13:09] chris-php at bolt dot cx

Pretty sure we're getting hit by this as well. We use serialize a lot
(memcached), and upgrading from PHP 4.3.9 to 4.3.10 tripled our
servers' load averages.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/31332

-- 
Edit this bug report at http://bugs.php.net/?id=31332&edit=1

Reply via email to