<div dir="ltr"><br>Cheers<br><div>Dan<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 4:20 PM, Galder Zamarreño <span dir="ltr">&lt;<a href="mailto:galder@redhat.com" target="_blank">galder@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Basically, the difference between Hot Rod then and now is: 32 bytes, which is: new metadata object, a reference to it, and 2 unusued longs for immortal entries.<br>


<br>
With embedded metadata (~191 bytes per entry): <a href="https://dl.dropboxusercontent.com/u/6148072/with-embedded.png" target="_blank">https://dl.dropboxusercontent.com/u/6148072/with-embedded.png</a><br>
With versioned entries (~159 bytes per entry): <a href="https://dl.dropboxusercontent.com/u/6148072/with-versioned.png" target="_blank">https://dl.dropboxusercontent.com/u/6148072/with-versioned.png</a><br>
<br>
And there&#39;s more: we have internal cache entries that have a reference to internal cache values, per entry. This is useful for some cases (cache stores…etc), but this extra reference to the value, plus the value object itself, is 16 bytes (how useful is it really to have a separate value instance to keep just the value? Needs reassessing its usefulness...).<br>


<br></blockquote><div><br>+1 to remove InternalCacheValue (I thought about storing 
InternalCacheValues directly in the DataContainer, but it would probably
 create too much garbage to create InternalCacheEntries all the time).<br><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
So really, I think the minimum Hot Rod overhead we should aim for is ~143 bytes. If each server module could define what the ICE class (well, classes to cover all immortal, mortal…etc cases) to use, which is purely designed for their servers (i.e. hot rod just needs: value + version; memcached needs: value + version + flags), we could get to this level…<br>


<br></blockquote><div><br></div><div>You mean embed the metadata fields directly in the ICE? Wouldn&#39;t that get us back to what we had before introducing the Metadata interface?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


You still want the metadata to be passed from the client, but for those specialised use cases in Infinispan, we could have a mapping between the metadata type and the type of ICEs created…<br>
<br></blockquote><div><br><div>If HotRod knows it always needs a ServerEntryVersion, it 
could implement EntryVersion directly in HotRodMetadata implementation that implements 
EntryVersion directly (version() returns this). This could even be combined with your idea, so we could have a HotRodInternalCacheEntry that implements InternalCacheEntry, Metadata, and EntryVersion :)<br><br></div> </div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If anyone has any other ideas, shout now! :)<br>
<br>
Cheers,<br>
<div class=""><div class="h5"><br>
On May 28, 2013, at 3:07 PM, Galder Zamarreño &lt;<a href="mailto:galder@redhat.com">galder@redhat.com</a>&gt; wrote:<br>
<br>
&gt; All, I&#39;ve managed to replicate this locally and I&#39;m now looking at the heap dumps.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; On May 27, 2013, at 5:34 PM, Galder Zamarreño &lt;<a href="mailto:galder@redhat.com">galder@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hmmmm, not the expected results. There&#39;s no way we should be consuming more memory per entry. It should definitely be less, particularly for Hot Rod and Memcached and about the same for REST. The fact that all of them grow seems to be there&#39;s an issue in the core impl.<br>


&gt;&gt;<br>
&gt;&gt; @Martin, can you generate a heap dump, say for Hot Rod (with 512b entries) at the end of the test (when the cache is still populated)?<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;&gt; On May 24, 2013, at 2:50 PM, Martin Gencur &lt;<a href="mailto:mgencur@redhat.com">mgencur@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt; so I gave it another try with latest Infinispan and Infinispan-server snapshots (HEAD: a901168, resp. bc432fa) . In short, the results are still the same for inVM mode but worse for client-server mode. Of course, I haven&#39;t changed anything in the test since last time.<br>


&gt;&gt;&gt;<br>
&gt;&gt;&gt; This time, I left out the results for 1MB entries because there&#39;s high distortion due to the low number of entries stored in a cache       (storing 100MB of data). Previously, the results looked better for HotRod compared to the first round of tests I did for ISPN 5.2. Now the results for HotRod are worst of the three measurements, inVM mode remains the same:<br>


&gt;&gt;&gt;<br>
&gt;&gt;&gt; HotRod (ISPN 5.2):<br>
&gt;&gt;&gt; entry size -&gt; overhead per entry<br>
&gt;&gt;&gt; 512B  -&gt; 174B<br>
&gt;&gt;&gt; 1kB   -&gt; 178B<br>
&gt;&gt;&gt; 10kB  -&gt; 176B<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; HotRod (ISPN 5.3-SNAPSHOT, a few weeks ago)<br>
&gt;&gt;&gt; 512B  -&gt; 159 (~ -9%)<br>
&gt;&gt;&gt; 1kB   -&gt; 159 (~ -11%)<br>
&gt;&gt;&gt; 10kB  -&gt; 154 (this is perhaps affected by the low number of entries stored in mem.)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; HotRod (ISPN 5.3-SNAPSHOT, now)<br>
&gt;&gt;&gt; 512B  -&gt; 191<br>
&gt;&gt;&gt; 1kB   -&gt; 191 (measured twice)<br>
&gt;&gt;&gt; 10kB  -&gt; 186 (looks a bit distorted already)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ------------------------<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Memcached (ISPN 5.2)<br>
&gt;&gt;&gt; 512B  -&gt; 184<br>
&gt;&gt;&gt; 1kB   -&gt; 181<br>
&gt;&gt;&gt; 10kB  -&gt; 182<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Memcached (ISPN 5.3-SNAPSHOT)<br>
&gt;&gt;&gt; 512   -&gt; 228<br>
&gt;&gt;&gt; 1kB   -&gt; 227<br>
&gt;&gt;&gt; 10kB  -&gt; 235<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --------------------------------<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; REST (ISPN 5.2)<br>
&gt;&gt;&gt; 512B  -&gt; 208<br>
&gt;&gt;&gt; 1kB   -&gt; 205<br>
&gt;&gt;&gt; 10kB  -&gt; 206<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; REST (ISPN 5.3-SNAPSHOT)<br>
&gt;&gt;&gt; 512   -&gt; 247<br>
&gt;&gt;&gt; 1kB   -&gt; 247<br>
&gt;&gt;&gt; 10kB  -&gt; 251<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ------------------------------------<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; inVM (ISPN 5.2)<br>
&gt;&gt;&gt; 512B  -&gt; 151<br>
&gt;&gt;&gt; 1kB   -&gt; 151<br>
&gt;&gt;&gt; 10kB  -&gt; 155<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; inVM (ISPN 5.3-SNAPSHOT)<br>
&gt;&gt;&gt; 512   -&gt; 150<br>
&gt;&gt;&gt; 1kB   -&gt; 150<br>
&gt;&gt;&gt; 10kB  -&gt; 150<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Martin<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Dne 23.5.2013 18:13, Mircea Markus napsal(a):<br>
&gt;&gt;&gt;&gt; Hi Martin,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Galder has finalised the remaining bits of ISPN-2281. Is it possible for you to re-run the test to see where we are with the memory consumption?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 13 May 2013, at 10:44, Galder Zamarreño<br>
&gt;&gt;&gt;&gt; &lt;<a href="mailto:galder@redhat.com">galder@redhat.com</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On May 7, 2013, at 4:55 PM, Manik Surtani &lt;<a href="mailto:msurtani@redhat.com">msurtani@redhat.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; On 7 May 2013, at 15:39, Martin Gencur &lt;<a href="mailto:mgencur@redhat.com">mgencur@redhat.com</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I can make a blog post once we have this for Memcached and REST. I guess it is not ready yet.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Yes please.  Nice work.  :)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Galder Zamarreño<br>
&gt;&gt; <a href="mailto:galder@redhat.com">galder@redhat.com</a><br>
&gt;&gt; <a href="http://twitter.com/galderz" target="_blank">twitter.com/galderz</a><br>
&gt;&gt;<br>
&gt;&gt; Project Lead, Escalante<br>
&gt;&gt; <a href="http://escalante.io" target="_blank">http://escalante.io</a><br>
&gt;&gt;<br>
&gt;&gt; Engineer, Infinispan<br>
&gt;&gt; <a href="http://infinispan.org" target="_blank">http://infinispan.org</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Galder Zamarreño<br>
&gt; <a href="mailto:galder@redhat.com">galder@redhat.com</a><br>
&gt; <a href="http://twitter.com/galderz" target="_blank">twitter.com/galderz</a><br>
&gt;<br>
&gt; Project Lead, Escalante<br>
&gt; <a href="http://escalante.io" target="_blank">http://escalante.io</a><br>
&gt;<br>
&gt; Engineer, Infinispan<br>
&gt; <a href="http://infinispan.org" target="_blank">http://infinispan.org</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
<br>
--<br>
Galder Zamarreño<br>
<a href="mailto:galder@redhat.com">galder@redhat.com</a><br>
<a href="http://twitter.com/galderz" target="_blank">twitter.com/galderz</a><br>
<br>
Project Lead, Escalante<br>
<a href="http://escalante.io" target="_blank">http://escalante.io</a><br>
<br>
Engineer, Infinispan<br>
<a href="http://infinispan.org" target="_blank">http://infinispan.org</a><br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div></div>