Memcache Slowing Down Drupal Running seige (load tester) without memcache enabled I see stats similar to this:

Transactions:                    560 hits
Availability:                 100.00 %
Elapsed time:                  59.42 secs
Data transferred:               6.25 MB
Response time:                  1.56 secs
Transaction rate:               9.42 trans/sec
Throughput:                     0.11 MB/sec
Concurrency:                   14.71
Successful transactions:         543
Failed transactions:               0
Longest transaction:           10.57
Shortest transaction:           0.00


Notice that I'm getting about 560 transactions in 60 seconds, 9.42 trans/sec.

When I enable memcache (using the PECL memcache module) and re-run siege I see much worse performance:

Transactions:                    133 hits
Availability:                 100.00 %
Elapsed time:                  59.94 secs
Data transferred:               1.34 MB
Response time:                  6.43 secs
Transaction rate:               2.22 trans/sec
Throughput:                     0.02 MB/sec
Concurrency:                   14.27
Successful transactions:         129
Failed transactions:               0
Longest transaction:           12.22
Shortest transaction:           0.00


Notice that I've decreased my performance significantly. I was only able to process 133 hits in 60 seconds and the throughput is 2.22 transactions per second.

I have memcache setup on its own dedicated system with 4GB of RAM and here are the parameters:  memcached -d -p 11211 -u memcached -m 2560 -c 2048 -P /var/run/memcached/memcached.pid

I noticed that if I go to /admin/reports/memcache I get the following PHP errors:

Notice: Undefined variable: stats in dmemcache_stats() (line 244 of /www/sites/all/modules/memcache/dmemcache.inc).
Warning: Invalid argument supplied for foreach() in dmemcache_stats() (line 244 of /www/sites/all/modules/memcache/dmemcache.inc).
Notice: Undefined variable: stats in dmemcache_stats() (line 263 of /www/sites/all/modules/memcache/dmemcache.inc).
There are no statistics being reported for this bin.


I'm not sure if that's related to the issue or not?

This is what I have in settings.php:

/**************************************************
 * MEMCACHE
 **************************************************/
// the path to the core cache file
include_once('./includes/cache.inc');
// the path to the memcache cache file
include_once('./sites/all/modules/memcache/memcache.inc');

$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['memcache_servers'] = array(
        'memcache.domain.local:11211' =&gt; 'cluster'
);

$conf['memcache_bins'] = array(
        'bin1' =&gt; 'cluster'
);

$conf['memcache_key_prefix'] = 's-drupal';


Why is memcache slowing down my site instead of speeding it up? Would switching to PECL memcached help?
The errors on the stats page are due to an unrelated issue with memcache reporting. I think the problem you have is with the conf setup. I believe it should be like this for a default set up where all tables are mapped to the same bin:

$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
$conf['memcache_servers'] = array(
    'memcache.domain.local:11211' =&gt; 'default'
);

$conf['memcache_key_prefix'] = 's-drupal';


If that doesn't do the trick you can explicitly code the mappings for each table:

$conf['memcache_bins'] = array(
  'cache' =&gt; 'default',
  'cache_filter' =&gt; 'default',
  'cache_menu' =&gt; 'default'
);


etc.