the write strategy of the client implement affects the set
tomash.brechko at gmail.com
Wed Mar 5 08:59:25 UTC 2008
On Wed, Mar 05, 2008 at 05:29:03 +0300, Maxim Dounin wrote:
> E.g. for 'noreply' commands recently introduced you have to use
> TCP_NODELAY anyway.
This depends on how you look on the problem. With 'noreply' you can't
tell when the command will take the effect (you won't get the reply,
so even if you push the command to the server, it will still be
unclear when it will be completed). If so, then there's no real need
to push the request. C::M::F does not use TCP_NODELAY at all. This
way the last chunk (and hence 'noreply' command execution) may be
delayed up to 500ms (time is from
http://en.wikipedia.org/wiki/Nagle_algorithm), but OTOH the throughput
will be better if you are sending other commands during this time.
For C::M::F I tried both TCP_NODELAY and TCP_CORK in all combinations,
but couldn't achieve any _repeatable_ latency improvement (i.e. I
observed both speedups and slowdowns on different runs; maybe I did
the measurements wrongly?). However switching to TCP_CORK in the
server when needed does really improve latency.
More information about the memcached