Memcache query issue

Events happening in the community are now at Drupal community events on www.drupal.org.
navaneeth_r's picture

I am trying to use the memcache.

I am logging the queries after and before enable memcache.

I am using following in _db_query function in database.mysql.inc I am using following code to log the queries.

if($_SERVER['REMOTE_ADDR'] == '192.168.99.180') {
$file = '/var/www/html/example/files/query.txt';
$handle = fopen($file,'a+');
fwrite($handle,$query."\r\n");
fclose($handle);
}

Before enable the memcache file size is 1.09 kb after enable the memcache the log file size is 11.09 kb.

In the memcache enable state I commented the following code then the queries are becoming 1.09 kb.

$conf = array(
'cache_inc' => './sites/all/modules/memcache/memcache.inc',
'memcache_servers' => array('localhost:11211' => 'default'),
'memcache_bins' => array('cache' => 'default','cache_views' => 'default', 'cache_page' => 'default', 'cache_path' => 'default','cache_filter' => 'default','cache_menu' => 'default'),
);

  1. I think the log file size should reduce after enable the memcache is it right?...
  2. Am i missed any configuration?.

I have attached the log file before and after memcache. I need your support.

Regards
R.Navaneethakrishnan.

AttachmentSize
querywithmemcahe.txt112.46 KB
querywithoutmemcache.txt1.39 KB

Comments

Devel

kbahey's picture

Why not use Devel module with its query logging, or the performance module (also in devel) instead of hacking core?

That said, I would expect the opposite to happen. If you are logged off, the few queries in the smaller file are from early bootstrap phases, or hook_init/hook_boot. Then there would be a query from the page cache.

If you are logged on, there would not be much difference between having memcache on or off (not entirely accurate, since variables are cached and such, but by and large you will not see a difference).

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

When I use the devel module,

navaneeth_r's picture

When I use the devel module, I didnt get the consistent result hence I use the custom query log.

Regards,
R.Navaneethakrishnan