Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

memcache, multiple instances vs single instance

Tags:

memcached

I've got an website running php/mysql. The app will be 'copied' multiple times. each instance will get its own database, set of php files (wildcard)domain, you get the idea.

Now some parts of the app is cached using memcache and I am wondering if it'd be better/faster/more convient to use

  • one memcache instance per app instance

  • or one big memcache instance and prefix each key with some unique token per app instance

I would guess the advantage to using a single memcache instance would be a large 'index table'

where as multiple memcache instances would cause more overhead

Thanks for any help

like image 854
Richard Deurwaarder Avatar asked Jan 21 '26 08:01

Richard Deurwaarder


1 Answers

Use one memcached instance and prefix your keys -- this is the easiest way to ensure optimal resource utilization. If you have a separate memcached instance per application instance, an unused, idle instance claims memory that your active instances can't use.

like image 165
Frank Farmer Avatar answered Jan 25 '26 19:01

Frank Farmer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!