WebFaction
Community site: login faq

Hi,

I recently configured memcached on a Webfaction server and it's now up and running. I've read everything, but I still have some questions.

I won't be using clusters or multiple servers or anything. So am I getting the maximum benefit of memcached with this simple settings.php config?

$conf = array(
   'cache_inc'           => './sites/all/modules/memcache/memcache.inc',
   'memcache_servers'    => array(
                           '127.0.0.1:25299' => 'default',),
   'memcache_key_prefix' => 'mysite',
);

Or should I do something more complex like this?

$conf += array(
      'cache_inc'        => './sites/all/modules/memcache/memcache.inc',
      'memcache_servers' => array(
         'unix:///home/user123/memcached.sock:0'  => 'default',
         'unix:///home/user123/memcached.sock:0'  => 'block',
         'unix:///home/user123/memcached.sock:0'  => 'content',
         'unix:///home/user123/memcached.sock:0'  => 'filter',
         'unix:///home/user123/memcached.sock:0'  => 'form',
         'unix:///home/user123/memcached.sock:0'  => 'menu',
         'unix:///home/user123/memcached.sock:0'  => 'page',
         'unix:///home/user123/memcached.sock:0'  => 'update',
         'unix:///home/user123/memcached.sock:0'  => 'views',
         'unix:///home/user123/memcached.sock:0'  => 'users'
      ),
      'memcache_bins'    => array(
         'cache'         => 'default',
         'cache_block'   => 'block',
         'cache_content' => 'content',
         'cache_filter'  => 'filter',
         'cache_form'    => 'form',
         'cache_menu'    => 'menu',
         'cache_page'    => 'page',
         'cache_update'  => 'update',
         'cache_views'   => 'views',
         'users'         => 'users'
      ),
    );

(I would have to change the sockets to ports for it to work on Webfaction)

And what about using memcached for user sessions on Drupal?

Any comments for exploiting memcached to the maximum? Thanks!

asked 26 Oct '12, 01:24

sb56637
13713
accept rate: 0%


It should not make much of a difference if you break them up like that as you are pointing them all to the same memcached instance. Of course only with a benchmark test of the server with both options deployed(like with the 'ab' tool) would you know. If you are planning on storing your sessions in memcached you will need a lot of RAM, it is typically better to store them on disk, or in the database.

permanent link

answered 26 Oct '12, 02:25

johns
5.4k312
accept rate: 23%

Thanks very much johns. So with just one pointer to "default", it will cache things like "blocks", "menus" and "pages"? Sorry for the dumb question, it's just that the term "default" is quite ambiguous.

(26 Oct '12, 09:30) sb56637
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×63
×34
×4

question asked: 26 Oct '12, 01:24

question was seen: 5,595 times

last updated: 26 Oct '12, 09:30

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM