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 Why would running the same command (SINTERSTORE) successively on Redis produce faster and faster results?

Date: Wed, 10 Oct 2012 15:20:04 -0700 (PDT)
From: AcidZombie24 <acidzombi...@gmail.com>
To: redis-db@googlegroups.com
Message-Id: <e7e0215c-160c-46e6-b290-87993076e460@googlegroups.com>
In-Reply-To: <042d7d24-0bdc-4bda-92b0-6fba993349a7@googlegroups.com>
References: <042d7d24-0bdc-4bda-92b0-6fba993349a7@googlegroups.com>
Subject: Re: Why would running the same command (SINTERSTORE) successively
 on Redis produce faster and faster results?
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_66_15659527.1349907604617"

------=_Part_66_15659527.1349907604617
Content-Type: multipart/alternative; 
	boundary="----=_Part_67_22269426.1349907604617"

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

You should wait for someone who actually knows what he is talking about to 
answer but my comment is do you have any idea how busy your machine was at 
the time? My initial thought is maybe its in the cache

On Wednesday, October 10, 2012 4:38:18 PM UTC-4, Royi Hagigi wrote:
>
> Apologies for the cross-post from StackOverflow, but I figured I'd get a 
> faster response here than there. I don't believe that redis caches the 
> results of commands, correct? If so, then why would I see the following on 
> my redis server for the same query. For reference, this is redis running in 
> a VM. I checked the smaps file as described in 
> http://redis.io/topics/latency and see no swapping on the OS level (all 
> 0kb in Swap for the process), but is it possible that running redis in a VM 
> pages memory to disk and back? Or... are these results expected due to some 
> kind of redis optimization for commonly run commands? 
>
>
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (4.46s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (3.77s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (0.92s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (0.64s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (0.67s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (0.73s)
> redis 127.0.0.1:6379[4]> scard ClientId:1637
> (integer) 796529
> redis 127.0.0.1:6379[4]> scard PublisherId:1
> (integer) 311092
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (1.88s)
> redis 127.0.0.1:6379[4]> sinterstore testdb ClientId:1637 PublisherId:1
> (integer) 240001
> (0.69s)
>
>
------=_Part_67_22269426.1349907604617
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

You should wait for someone who actually knows what he is talking about to =
answer but my comment is do you have any idea how busy your machine was at =
the time? My initial thought is maybe its in the cache<br><br>On Wednesday,=
 October 10, 2012 4:38:18 PM UTC-4, Royi Hagigi wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><span style=3D"color:rgb(0,0,0);font-family:Arial,'=
Liberation Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:18px">=
Apologies for the cross-post from StackOverflow, but I figured I'd get a fa=
ster response here than there. I don't believe that redis caches the result=
s of commands, correct? If so, then why would I see the following on my red=
is server for the same query. For reference, this is redis running in a VM.=
 I checked the smaps file as described in</span><span style=3D"color:rgb(0,=
0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;font-size=
:14px;line-height:18px">&nbsp;</span><a href=3D"http://redis.io/topics/late=
ncy" rel=3D"nofollow" style=3D"color:rgb(74,107,130);font-family:Arial,'Lib=
eration Sans','DejaVu Sans',sans-serif;font-size:14px;line-height:18px;back=
ground-color:transparent" target=3D"_blank">http://redis.io/topics/<wbr>lat=
ency</a><span style=3D"color:rgb(0,0,0);font-family:Arial,'Liberation Sans'=
,'DejaVu Sans',sans-serif;font-size:14px;line-height:18px">&nbsp;</span><sp=
an style=3D"color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sa=
ns',sans-serif;font-size:14px;line-height:18px">and see no swapping on the =
OS level (all 0kb in Swap for the process), but is it possible that running=
 redis in a VM pages memory to disk and back? Or... are these results expec=
ted due to some kind of redis optimization for commonly run commands?&nbsp;=
</span><div><font color=3D"#000000" face=3D"Arial, Liberation Sans, DejaVu =
Sans, sans-serif"><span style=3D"font-size:14px;line-height:18px"><br></spa=
n></font><div><table style=3D"border-collapse:collapse;color:rgb(0,0,0);fon=
t-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:12px"=
><tbody style=3D"background-color:transparent"><tr style=3D"background-colo=
r:transparent"><td style=3D"vertical-align:top;background-color:transparent=
;width:60px"><br></td><td style=3D"background-color:transparent"><div style=
=3D"background-color:transparent"><div style=3D"margin-right:5px;margin-bot=
tom:5px;font-size:14px;background-color:transparent;width:660px;line-height=
:18px"><pre style=3D"margin-bottom:10px;padding:5px;background-color:rgb(23=
8,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation M=
ono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,=
serif;overflow:auto;width:auto;max-height:600px"><code style=3D"font-family=
:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono=
','Bitstream Vera Sans Mono','Courier New',monospace,serif">redis 127.0.0.1=
:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(4.46s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(3.77s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.92s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.64s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.67s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.73s)
redis 127.0.0.1:6379[4]&gt; scard ClientId:1637
(integer) 796529
redis 127.0.0.1:6379[4]&gt; scard PublisherId:1
(integer) 311092
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(1.88s)
redis 127.0.0.1:6379[4]&gt; sinterstore testdb ClientId:1637 PublisherId:1
(integer) 240001
(0.69s)</code></pre></div></div></td></tr></tbody></table></div></div></blo=
ckquote>
------=_Part_67_22269426.1349907604617--

------=_Part_66_15659527.1349907604617--