gregoriusxu / booksleeve

Automatically exported from code.google.com/p/booksleeve
Other
0 stars 0 forks source link

Bad performance in high load scenarios due to absence of buffer on network access. #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Try to execute a command with a lot of arguments, e.g. MSET or MGET with 20 
000 keys. 
2.All the arguments from will be sent as a separate network package, e.g. it 
would look like the following (each line is a separate TCP package)
*
20001
\r\n
$
4
MGET
\r\n
$
4
key1
\r\n
$
4
key2
\r\n

It is because data is not buffering but each pice of data is sent directly to 
NetworkStream, which wrapps the socket.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Booksleeve 0.9, Win 2008 x64 R2

Please provide any additional information below.
I observed such behavior by WireShark network sniffer, I simply added a buffer 
to write the whole command into MemoryStream, which then flushed to 
NetworkStream, and get 10x times better performance for my test where 1 thread 
tries to do Read and then Write 20000 keys from/to Redis with 32 bytes length 
random values.

Original issue reported on code.google.com by Alfiia.M...@gmail.com on 16 Aug 2011 at 8:25

GoogleCodeExporter commented 8 years ago
I'd need to check what version is on nuget, but the source has had a buffer 
here for a while. 2 secs while I check...

Original comment by marc.gravell on 16 Aug 2011 at 8:53

GoogleCodeExporter commented 8 years ago
Confirmed - the version on nuget does not include this change; I'll get the 1.0 
API changes completed so I can build (it is in an intermediate state at the 
moment, locally). However, this change is already implemented.

Original comment by marc.gravell on 16 Aug 2011 at 8:58

GoogleCodeExporter commented 8 years ago
It sounds great could you also publish version 1.0 with source code here on 
code.google.com ?

Original comment by Alfiia.M...@gmail.com on 16 Aug 2011 at 9:23

GoogleCodeExporter commented 8 years ago
I fully intend to - my local branch needs a little work first (working on it 
right now)

Original comment by marc.gravell on 16 Aug 2011 at 11:01

GoogleCodeExporter commented 8 years ago
I've just pushed my updated trunk; this is *not* the full 1.0 (I need to finish 
a few more API moves), but it should be stable and include the buffering.

Original comment by marc.gravell on 16 Aug 2011 at 10:56

GoogleCodeExporter commented 8 years ago

Original comment by marc.gravell on 12 Dec 2011 at 9:26