memcached and streaming
Maxim Dounin
mdounin at mdounin.ru
Mon Feb 4 03:34:57 UTC 2008
Hello!
On Sun, Feb 03, 2008 at 05:32:16PM +0300, Tomash Brechko wrote:
>Hello,
>
>In memcached.c there's a line,
>
> setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags));
>
>We should realise that this is a serious performance killer for
>streaming. For instance, C::M::F has multi-update commands that are
>capable to bundle several requests into one network packet. However
>replies are always sent _one at a time_. I.e. tons of packets with
>single 'STORED' etc. (>40 bytes header and 6 bytes of data---not the
>best ratio). Not to say the the greater number of packets means a
>huge increase of latency in a congested network.
>
>memcached should have in its TODO "Disable TCP_NODELAY and enable
>TCP_CORK/TCP_NOPUSH for streaming". The server may tell if the
Just a quick note: the code to set/clear TCP_NOPUSH was here
before iov work was merged from facebook at r320 (i.e. in 1.1.*
branch).
Maxim Dounin
More information about the memcached
mailing list