My first responce would be to put memcached on both servers at 512mb.

My other peice of advice on multi-server environments is not to have
instances of different sizes in the same cluster.   I like to keep all my
instances of the same size, even if the machine has more ram available, in
which case I would start up multiple instances on it.

The advantage of having memcached on multiple servers, is that if you need
to shutdown one of the machines for any reason, you do not lose the entire
cache.

Since memcache is meant to be faster and less expensive than making a
database call.  In your 'after' scenario, you will be making the database
call to the second machine anyway, so any calls to memcache would still be
better than hitting the database.

my mid/small sites are run in a similar config.

Server A (only 2gb of ram)
  Apache (which handles static files, and load-balanced calls to my apps)
  Static files
  Memcached 1gb
  Appserver

Server B (4gb ram)
  Database
  Memcached (1gb)
  Memcached (1gb)
  Appserver
  All cron/timed/maintenance tasks.

I have a total of 3gb for memcache, which is only ever about a quarter used.

Of course, every situation is different though.



On Tue, Feb 10, 2009 at 10:00 AM, Mark Carey <[email protected]> wrote:

>
> I am looking for some advice on an optimal configuration for
> memcached, for a popular Movable Type (v4.23) blog that is moving from
> a single box config to a 2-box config, as described below.
>
> Here is the "before" scenario of a busy live site:
>
> -Everything on one box (static html files, perl-based Movable Type
> (MT) app, mysql server)
> -box has 4GB RAM total
> -memcached running and enabled in MT 4.23, with 512MB allocated
> -based on memcached stats, the full 512 MB is not being used by
> memcached, even after doing a full rebuild, etc.
>
> Essentially memcached seems to be running well with the built support
> for memcached in MT 4.23.  (Side note: I
> am a little surprised that the full 512 isn't being used, but I am not
> a memcached expert and I haven't attempted to calculate what the
> memory footprint of all the objects in MT should amount to. FWIW,
> there are thousands of blog entries and 50K+ comments, etc.)
>
> In any event, the "after" scenario looks like:
>
> Box 1 (same box as above):
> -static HTML files
> -MT app
> -box still has 4 GB RAM
>
> Box 2:
> -dedicated for mysql server (only the MT database)
> -box has *8* GB of RAM total
> -is on same local network as Box 1, connected via GB switch
>
> The question is: what to do with memcached?  A few options come to
> mind, but I am not sure which is best:
>
> 1) Run memcached on both, leveraging memory from both servers (but
> does that make sense given that the current setup isn't using the 512
> MB allocated?) If both, how much RAM to allocate to each?
>
> 2) Keep in the way it is, memcached running on the same box as MT, 512
> MB allocated (rationale: don't seem to need more than 512MB, and local
> RAM is presumably fastest?)
>
> 3) Run memcached *only* on the DB box, and not at all on the MT app
> box (rationale: MT app/webserver box only has 4GB of RAM so best to
> save that RAM for apache/perl and take advantage of some of the 8 GB
> of RAM on the new DB box for memcached).
>
> Thoughts, advice?
>
> Thanks,
>
> Mark




-- 
"Be excellent to each other"

Reply via email to