On Fri, Apr 23, 2010 at 4:29 PM, Heath Oderman <he...@526valley.com> wrote: > Really interesting find. > After Jonathan E. suggested py_stress and it seemed clear the problem was in > my .net client I spent a few days debugging the client in detail. > I ended up changing my CassandraContext instantiation to use a > TBuffferedProtocol(TSocket) instead of a > TSocket directly. > The difference was *dramatic*.
Heath, thank you for this awesome tip. I also have a dotNet client and I will make an experiment with your findings. Do you mean TBufferedTransport(TSocket)? I was unable to find TBufferedProtocol in Thrift generated code. Looking inro the code of both classes (TBufferedTransport and TSocket) I saw the former uses buffered streams and the latter doens't (which is pretty clear taking into account its names :-) ). Also, I've seen that a operation (for instance, a get) implies many writes to the underlying stream: a WriteMessageBegin which in turns is three writes to the stream, a WriteFieldBegin (2 writes) and so on. If every of them is a actual roundtrip to the network and waits for the ACK you could find a big difference between these two clases. It explains the improvement but not the diference you experienced. Assuming both boxes are in the same net, it could had been caused by diferent quality network hardware/drivers. Even in the same net, windows could assign diferent MTU size and Receive Window size depending on the other end. Again, thank you very much for pointing this direction (maybe,if the test are sucessfull, it would deserve an update in the C# client sample in the wiki). Carlos.