<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi!<div><br class="webkit-block-placeholder"></div><div>So I am looking at increasing the performance in libmemcached. Looking at how some of the other clients are implemented I am finding a catch-22 that I am hoping someone can explain.</div><div><br class="webkit-block-placeholder"></div><div>Most clients seem to be setting their IO to non-blocking, which is excellent, but I don't understand what this is really buying since:</div><div>1) Clients are not threaded</div><div>2) The protocol always sends an ACK of some sort.</div><div><br class="webkit-block-placeholder"></div><div>Take "set" for example. I can do a "set" which is non-blocking, but then I have to sit and spin either in the kernel or in user space waiting for the "STORED" to be returned. This seems to defeat the point of non-blocking IO. </div><div><br class="webkit-block-placeholder"></div><div>I must be missing something about the above, since I can't see why there is a benefit to dealing with non-blocking IO on a set, if you will just end up waiting on the read() (ok, recv()).</div><div><br class="webkit-block-placeholder"></div><div>On a different related note, I've noticed another issue with "set". When I send a "set foo 0 0 20\r\n", I have to just send that message. I can't just drop the "set" and the data to be stored in the same socket. If I do that, then the server removes whatever portion of the key that was contained in the "set". Maybe this is my bug (though I can demonstrate it), but that seems like a waste. AKA if on the server its doing a read() for the set and tossing out the rest of the packet then its purposely causing two roundtrips for the same data.</div><div><br class="webkit-block-placeholder"></div><div>Looking through all of this, I am hoping that the binary protocol, which I eagerly await reading, has a "set" which doesn't bother to tell me what the result of the "set" was. You could pump a lot more data into memcached if this was the case. </div><div><br class="webkit-block-placeholder"></div><div>Cheers,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-Brian<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Brian "Krow" Aker, brian at tangent.org</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Seattle, Washington</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://krow.net/"><span class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; ">http://krow.net</span></span></a>/ <-- Me</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://tangent.org/"><span class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; ">http://tangent.org</span></span></a>/ <-- Software</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://exploitseattle.com">http://exploitseattle.com</a>/ <-- Fun</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">You can't grep a dead tree.</div><br class="Apple-interchange-newline"></span></span> </div><br></div></body></html>