<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 6 Sep 2005, at 16:33, Russell Garrett wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR><DIV><DIV>On 6 Sep 2005, at 14:25, Alex Stapleton wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV>Hi Russ ;)</DIV><DIV><BR class="khtml-block-placeholder"></DIV>Very short timeouts and machine local status tables (in memcached / turckmmcache / eaccelerator / whatever you want ) seem to produce pretty reliable fail over for us. Throw in some timeout's and register_shutdown_functions()s to recheck the server periodically and it actually starts to get pretty nice.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>As long as your connect() time-out is low enough to merely make it look like the page took slightly longer than normal to load, you shouldn't have anything to worry about. It means you have a higher potential for false positives but we haven't had any of those yet with our time-out set to 500 ms.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Even if you use something which has a habit of forgetting about keys (e.g. turck) it's not too painful as the failed connection attempt ratio still tends to stay low enough to not be particularly noticeable.<DIV><DIV><DIV><BLOCKQUOTE type="cite"></BLOCKQUOTE></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><FONT class="Apple-style-span" color="#006312"><BR class="khtml-block-placeholder"></FONT><DIV><FONT class="Apple-style-span" color="#006312">It *is* you...</FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"><BR class="khtml-block-placeholder"></FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312">No chance on going open-source on your code then? Or I'll have to do it myself... Someone's got to do it sooner or later.</FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"><BR class="khtml-block-placeholder"></FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312">I was somewhat resigned to doing it myself in the end, but I completely forgot about eaccelerator as a means of local shared memory.</FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"><BR class="khtml-block-placeholder"></FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312">I'm certainly not going back to a libmemcache-based solution in a hurry after the amount of grief it's caused me over the various times I've tried it.</FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"><BR class="khtml-block-placeholder"></FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312">Russ</FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"><A href="mailto:russ@last.fm">russ@last.fm</A></FONT></DIV><DIV><FONT class="Apple-style-span" color="#006312"></FONT></DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Of course it's me :P</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Currently we aren't using memcached in production but we are planning to shift some stuff onto it soon. We use that technique to get around having to use the (generally crap and ancient) F5 load balancers </DIV><DIV>which have been in use for eon's because someone didn't think about the bottleneck it might cause. I see no reason why it wouldn't work for memcached though. So no, I don't have any memcached code that I could open source.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>apr_memcached looks good. I've not used it though. I believe SWIG has some vague PHP support these days, so that might make life a bit lazier too. Personally I think the best solution is probably sticking with your existing code for now and extending it with PHP as much as you can. Unless your getting crap performance from your PHP code, in which case I don't see anything wrong with just enhancing the PECL module to whatever your PHP code looks slowest. It's not like a bit of C is beyond your abilities ;)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Considering maintaining the server list turned out to be about 30-40 lines of code at most, it's really not a big deal to implement. I can probably rip out the relevant bits and e-mail them to you for inspiration if you want? It's probably bugged anyway, so some fresh eyes would do it good.</DIV></BODY></HTML>