Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Bad perfomance of mass insertion to Redis DB with Sider .NET client

Received: by 10.224.223.14 with SMTP id ii14mr367647qab.3.1349947188170;
        Thu, 11 Oct 2012 02:19:48 -0700 (PDT)
X-BeenThere: redis-db@googlegroups.com
Received: by 10.224.180.143 with SMTP id bu15ls2926799qab.4.gmail; Thu, 11 Oct
 2012 02:19:44 -0700 (PDT)
Received: by 10.224.223.14 with SMTP id ii14mr367585qab.3.1349947184259;
        Thu, 11 Oct 2012 02:19:44 -0700 (PDT)
Received: by 10.224.28.72 with SMTP id l8msqac;
        Thu, 11 Oct 2012 02:14:35 -0700 (PDT)
Received: by 10.52.71.82 with SMTP id s18mr17734vdu.9.1349946875000;
        Thu, 11 Oct 2012 02:14:35 -0700 (PDT)
Date: Thu, 11 Oct 2012 02:14:34 -0700 (PDT)
From: =?UTF-8?B?0JzQsNC60YEg0JHQsNGA0YLQtdC90LXQsg==?= <maxten...@gmail.com>
To: redis-db@googlegroups.com
Message-Id: <256f04e7-7080-4323-b60c-0873f259cd59@googlegroups.com>
Subject: Bad perfomance of mass insertion to Redis DB with Sider .NET client
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_419_30899054.1349946874578"

------=_Part_419_30899054.1349946874578
Content-Type: multipart/alternative; 
	boundary="----=_Part_420_32021692.1349946874579"

------=_Part_420_32021692.1349946874579
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit



I need to insert about one million key-value pairs in *Redis DB<http://redis.io/>
*. I have a Redis server instance on the same computer with my C# 
application. I use *Sider <https://github.com/chakrit/sider>* client to 
connect to Redis. All settings are default. The following code executes for 
*4 seconds*:

    redis_client.Pipeline(c =>
    {
        for (int i = 0; i < 1000; ++i)
        {
            Console.Write("\r" + i);
            string key = "aaaaaaaaaaa" + i;
            string value = "bbbbbbbbbb";
            c.Set(key, value);
        }
    });

I tried both usual and pipeline method of insertion. Standard benchmark of 
Redis shows similar results. CPU or HDD have no problems and them enough 
for another mass insertion in different databases.*Official benchmark page<http://redis.io/topics/benchmarks>
* of Redis says about possibility of ~100000 SET operations per second. I 
have less then 1000... What's the problem?

------=_Part_420_32021692.1349946874579
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p style=3D"font-size: 14px; clear: both; word-wrap: break-word; color: rgb=
(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif=
; ">I need to insert about one million key-value pairs in&nbsp;<strong styl=
e=3D"background-color: transparent; "><a href=3D"http://redis.io/" rel=3D"n=
ofollow" style=3D"background-color: transparent; color: rgb(74, 107, 130); =
cursor: pointer; ">Redis DB</a></strong>. I have a Redis server instance on=
 the same computer with my C# application. I use&nbsp;<strong style=3D"back=
ground-color: transparent; "><a href=3D"https://github.com/chakrit/sider" r=
el=3D"nofollow" style=3D"background-color: transparent; color: rgb(74, 107,=
 130); cursor: pointer; ">Sider</a></strong>&nbsp;client to connect to Redi=
s. All settings are default. The following code executes for&nbsp;<strong s=
tyle=3D"background-color: transparent; ">4 seconds</strong>:</p><pre class=
=3D"default prettyprint" style=3D"margin-bottom: 10px; padding: 5px; font-s=
ize: 14px; background-color: rgb(238, 238, 238); font-family: Consolas, Men=
lo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitst=
ream Vera Sans Mono', 'Courier New', monospace, serif; overflow: auto; widt=
h: auto; max-height: 600px; color: rgb(0, 0, 0); line-height: 18px; "><code=
 style=3D"font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberati=
on Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', mo=
nospace, serif; "><span class=3D"pln" style=3D"background-color: transparen=
t; ">&nbsp; &nbsp; redis_client</span><span class=3D"pun" style=3D"backgrou=
nd-color: transparent; ">.</span><span class=3D"typ" style=3D"background-co=
lor: transparent; color: rgb(43, 145, 175); ">Pipeline</span><span class=3D=
"pun" style=3D"background-color: transparent; ">(</span><span class=3D"pln"=
 style=3D"background-color: transparent; ">c </span><span class=3D"pun" sty=
le=3D"background-color: transparent; ">=3D&gt;</span><span class=3D"pln" st=
yle=3D"background-color: transparent; "><br>&nbsp; &nbsp; </span><span clas=
s=3D"pun" style=3D"background-color: transparent; ">{</span><span class=3D"=
pln" style=3D"background-color: transparent; "><br>&nbsp; &nbsp; &nbsp; &nb=
sp; </span><span class=3D"kwd" style=3D"background-color: transparent; colo=
r: rgb(0, 0, 139); ">for</span><span class=3D"pln" style=3D"background-colo=
r: transparent; "> </span><span class=3D"pun" style=3D"background-color: tr=
ansparent; ">(</span><span class=3D"kwd" style=3D"background-color: transpa=
rent; color: rgb(0, 0, 139); ">int</span><span class=3D"pln" style=3D"backg=
round-color: transparent; "> i </span><span class=3D"pun" style=3D"backgrou=
nd-color: transparent; ">=3D</span><span class=3D"pln" style=3D"background-=
color: transparent; "> </span><span class=3D"lit" style=3D"background-color=
: transparent; color: rgb(128, 0, 0); ">0</span><span class=3D"pun" style=
=3D"background-color: transparent; ">;</span><span class=3D"pln" style=3D"b=
ackground-color: transparent; "> i </span><span class=3D"pun" style=3D"back=
ground-color: transparent; ">&lt;</span><span class=3D"pln" style=3D"backgr=
ound-color: transparent; "> </span><span class=3D"lit" style=3D"background-=
color: transparent; color: rgb(128, 0, 0); ">1000</span><span class=3D"pun"=
 style=3D"background-color: transparent; ">;</span><span class=3D"pln" styl=
e=3D"background-color: transparent; "> </span><span class=3D"pun" style=3D"=
background-color: transparent; ">++</span><span class=3D"pln" style=3D"back=
ground-color: transparent; ">i</span><span class=3D"pun" style=3D"backgroun=
d-color: transparent; ">)</span><span class=3D"pln" style=3D"background-col=
or: transparent; "><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class=3D"pu=
n" style=3D"background-color: transparent; ">{</span><span class=3D"pln" st=
yle=3D"background-color: transparent; "><br>&nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; </span><span class=3D"typ" style=3D"background-color: transparen=
t; color: rgb(43, 145, 175); ">Console</span><span class=3D"pun" style=3D"b=
ackground-color: transparent; ">.</span><span class=3D"typ" style=3D"backgr=
ound-color: transparent; color: rgb(43, 145, 175); ">Write</span><span clas=
s=3D"pun" style=3D"background-color: transparent; ">(</span><span class=3D"=
str" style=3D"background-color: transparent; color: rgb(128, 0, 0); ">"\r"<=
/span><span class=3D"pln" style=3D"background-color: transparent; "> </span=
><span class=3D"pun" style=3D"background-color: transparent; ">+</span><spa=
n class=3D"pln" style=3D"background-color: transparent; "> i</span><span cl=
ass=3D"pun" style=3D"background-color: transparent; ">);</span><span class=
=3D"pln" style=3D"background-color: transparent; "><br>&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; </span><span class=3D"kwd" style=3D"background-color:=
 transparent; color: rgb(0, 0, 139); ">string</span><span class=3D"pln" sty=
le=3D"background-color: transparent; "> key </span><span class=3D"pun" styl=
e=3D"background-color: transparent; ">=3D</span><span class=3D"pln" style=
=3D"background-color: transparent; "> </span><span class=3D"str" style=3D"b=
ackground-color: transparent; color: rgb(128, 0, 0); ">"aaaaaaaaaaa"</span>=
<span class=3D"pln" style=3D"background-color: transparent; "> </span><span=
 class=3D"pun" style=3D"background-color: transparent; ">+</span><span clas=
s=3D"pln" style=3D"background-color: transparent; "> i</span><span class=3D=
"pun" style=3D"background-color: transparent; ">;</span><span class=3D"pln"=
 style=3D"background-color: transparent; "><br>&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; </span><span class=3D"kwd" style=3D"background-color: transpa=
rent; color: rgb(0, 0, 139); ">string</span><span class=3D"pln" style=3D"ba=
ckground-color: transparent; "> value </span><span class=3D"pun" style=3D"b=
ackground-color: transparent; ">=3D</span><span class=3D"pln" style=3D"back=
ground-color: transparent; "> </span><span class=3D"str" style=3D"backgroun=
d-color: transparent; color: rgb(128, 0, 0); ">"bbbbbbbbbb"</span><span cla=
ss=3D"pun" style=3D"background-color: transparent; ">;</span><span class=3D=
"pln" style=3D"background-color: transparent; "><br>&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; c</span><span class=3D"pun" style=3D"background-color: t=
ransparent; ">.</span><span class=3D"typ" style=3D"background-color: transp=
arent; color: rgb(43, 145, 175); ">Set</span><span class=3D"pun" style=3D"b=
ackground-color: transparent; ">(</span><span class=3D"pln" style=3D"backgr=
ound-color: transparent; ">key</span><span class=3D"pun" style=3D"backgroun=
d-color: transparent; ">,</span><span class=3D"pln" style=3D"background-col=
or: transparent; "> value</span><span class=3D"pun" style=3D"background-col=
or: transparent; ">);</span><span class=3D"pln" style=3D"background-color: =
transparent; "><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class=3D"pun" s=
tyle=3D"background-color: transparent; ">}</span><span class=3D"pln" style=
=3D"background-color: transparent; "><br>&nbsp; &nbsp; </span><span class=
=3D"pun" style=3D"background-color: transparent; ">});</span><span class=3D=
"pln" style=3D"background-color: transparent; "><br></span></code></pre><p =
style=3D"font-size: 14px; clear: both; word-wrap: break-word; color: rgb(0,=
 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; "=
>I tried both usual and pipeline method of insertion. Standard benchmark of=
 Redis shows similar results. CPU or HDD have no problems and them enough f=
or another mass insertion in different databases.<strong style=3D"backgroun=
d-color: transparent; "><a href=3D"http://redis.io/topics/benchmarks" rel=
=3D"nofollow" style=3D"background-color: transparent; color: rgb(74, 107, 1=
30); cursor: pointer; ">Official benchmark page</a></strong>&nbsp;of Redis =
says about possibility of ~100000 SET operations per second. I have less th=
en 1000... What's the problem?</p>
------=_Part_420_32021692.1349946874579--

------=_Part_419_30899054.1349946874578--