memcached and streaming

dormando dormando at rydia.net
Mon Feb 4 07:05:27 UTC 2008


Tomash Brechko wrote:
> On Sun, Feb 03, 2008 at 19:39:59 -0800, dormando wrote:
>>> 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).
> 
> Yep, thanks, I've seen that changeset too.  But I had an impression
> that while having TCP_NOPUSH it did something else with it (like
> switching to it during a single reply, because then each chunk was
> sent separately, there was no iov stuff).
> 
> 
>> Yeah; I want to rewrite the way the iov code works... It's not flexible
>> enough, relies on mallocing lists _per conn structure_ instead of a
>> linked list, and in certain conditions uses too many packets.
> 
> Well, you may do that, but this has nothing to do with my proposal.  I
> simply suggest to switch between TCP_NODELAY and TCP_CORK/TCP_NOPUSH
> depending on the situation.

I think it'd be easier to do that if the iov stuff was refactored a bit,
partially because...

> 
> ...And binary protocol got rid of mget, because everyone is supposed
> to go streaming ;).

... we'd need to use it to refactor the binary tree to not write single
packets for mget. This is one of my major concerns for the binary tree
as-is, but I've had no time to really figure it out. While cork/nopush
should give us the desired effect of coalescing packets, we'll still
save significant performance (especially on the BSD's) if we can combine
the syscalls down some.

> 
> It probably would be cleaner to just implement it myself and show the
> patch, but I have no time for that right now, only can talk big :).
> 

Wank ;)

-Dormando



More information about the memcached mailing list