I have two applications with exactly the same code using memcached in identical ways. Does memcached tell the difference between the two apps, and is it safe to run them on the same server with a single memcached server?
|
Probably no, as both instances would use the same keys. Maybe you can find a way to prefix the keys of each application. |
|||
|
|
You could run two instances of memcache in the server listening in different ports. e.g. memcached -p 11211 -d memcached -p 11212 -d You would only need to make a small change to one of the code copies so it connects to the other memcached port. Without the two memcache instances and the small port change I wouldn't see a way for the applications not to collide. |
|||
|
|
|
you will clash the value for the same key. memcache is not aware by who inserts data but what data is inserted. you can check by telnet localhost memcache port 11211 but it may be changed into your environment, then insert from your first app a key value , retrieve it with get and then do the same for the second app if the value changed for the same key is sure that you overwrite the value for that key. I use the same memcache server but for each app I give a namespace. |
|||
|
|