Currently we are storing our user sessions in memcached, our web apps are running with PHP 5.3.6 and Apache 2.2.3.
We will be replacing our memcached server, I am wondering if there is a way we can transfer the data from one memcached server to another so that the user sessions are still there. (To minimize downtime)
Although I have read from the FAQ http://code.google.com/p/memcached/wiki/FAQ#How_can_you_dump_data_from_or_load_data_into_memcached? that it is probably not possible to do that...but I am hoping if someone have some tools or workaround to achieve this.
Thanks!
Best regards
It's possible with memcached-tool.
memcached-tool 10.1.2.30:11211 dump | nc 127.0.0.1 11211
Your best bet is to probably add some code into your system that, when a user visits, writes the session into both the new server and the old one, and then let them run in parallel for a while, then turn off the old server. That way you can "warm up" the new server without actually depending on it, and then swap over once most of the sessions are moved over.
You'll still lose some sessions, but the most frequent visitors won't notice anything because their sessions will have been moved over.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With