Skip to content

PHP crash in get() when using persistence #59

Closed
@doapp-ryanp

Description

@doapp-ryanp

I am getting intermittent problems when doing a get() - every few hundred requests PHP is crashing. I've narrowed it down to to a libmemcached/io.cc: No such file or directory error - but I only get this when PHP crashes. About 1% of my requests result in the crash (which caues HTTP 502).

My environment:
Ubuntu 12.04 64bit: Linux ryan 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64
nginx 1.2.4
php5-fpm:

/usr/sbin/php5-fpm -v
PHP 5.3.10-1ubuntu3.4 (fpm-fcgi) (built: Sep 12 2012 19:03:32)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

PECL memcached 2.1.0:

memcached

memcached support => enabled
Version => 2.1.0
libmemcached version => 1.0.15
Session support => yes
igbinary support => yes
json support => no

Directive => Local Value => Master Value
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.serializer => igbinary => igbinary
memcached.sess_binary => 0 => 0
memcached.sess_lock_wait => 150000 => 150000
memcached.sess_locking => 1 => 1
memcached.sess_prefix => memc.sess.key. => memc.sess.key.

Lots of memory:

free -m
             total       used       free     shared    buffers     cached
Mem:         15982      15712        270          0        462       9171
-/+ buffers/cache:       6078       9903
Swap:         3813          0       3813

Here is test script to reproduce (test.php):

<?php

$m = new Memcached('mc');
$m->addServer('localhost', 11211);

$d = $m->get('foo');
if(empty($d)){
    $m->set('foo', 100);
}
var_export($d);
echo $m->getResultMessage(),"\n";

Here is my GDB: https://gist.github.com/4b966fa47cd0515ddf25
Here is the core dump: https://dl.dropbox.com/u/1374786/core-php5-fpm.19325.bz2

then simply run ab -n 1000 -c 20 http://localhost/test.php

Any idea what is going on? Is this really a bug in libmemcached?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions