[merge] readv for the smart server

John Arbash Meinel john at arbash-meinel.com
Sat Sep 16 05:19:48 BST 2006


Attached is a patch which adds readv() support for the smart server
protocol.

It isn't very tricky. The protocol basically just calls 'readv', and
passes as text a newline separated list of comma separated
'start,length' pairs.
The server then calls _base_transport.readv() and returns the raw data
bytes. Originally, I was thinking to chunk up all of the bytes, but the
code doesn't really support multiple chunks all that well, since each
chunk would have to end with 'done\n'.

We *could* do a little bit more for integrity, etc. But this works, and
should perform well.

Over the loopback, this provides very little benefit. But in general, it
has the same performance (within a second or so). There is a little more
work for both sides, because they have to serialize and deserialize the
readv request.

However, over a 35ms latency, 160KB/s connection, this changes the time
for updating from revno 2000 => 2017 from 3m10s down to 38s. So quite a
big drop. For comparison, http 38s takes and sftp takes 51s. To do the
same pull.

So, it would seem that we have a protocol comparable to http on our hands :)

Also, just to give some general performance information push is faster
than sftp too. It does this because of a lot fewer round trips per
operation. This connection has a 30KB/s upload cap. To push from 2000 =>
2017 takes 1m2s (The new code doesn't change this). Over 'sftp' it takes
1m24s.

I have another branch where I'm implementing 'put_bytes_non_atomic'.
Which should save us a bunch more time when pushing a new branch.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-server-readv.diff
Type: text/x-patch
Size: 5242 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060915/5fe5a31f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060915/5fe5a31f/attachment.pgp 


More information about the bazaar mailing list