<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/elise-ebay/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 12 Mar 2014 11:46:33 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/elise-ebay/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="final-conclusions"&gt;Final Conclusions&lt;/h1&gt;
&lt;p&gt;Impl3, the no lock implementation, is the fastest one but is most sensitive to jitter and GC operations. &lt;/p&gt;
&lt;h2 id="gc-and-gc-dedicated-threads"&gt;GC and GC dedicated threads&lt;/h2&gt;
&lt;p&gt;As always, we need to keep at least 1 thread (and associated core) for doing GC work.  This would always be done - must allow for at least 1 dedicated thread (and core) for GC and operating systemm overhead.&lt;/p&gt;
&lt;h2 id="impact-of-concurrenthashmap-interaction"&gt;Impact of concurrentHashMap Interaction&lt;/h2&gt;
&lt;p&gt;The max throughput with the BidKeeper active is 1.7M bids/sec.  The performance with the BidKeeper inactive is 3M bids/sec.&lt;/p&gt;
&lt;p&gt;Hence, the interaction with the BidKeeper slows the system down by 300k bids/sec. - around 11% (.3/2.7 ~ 11%).&lt;/p&gt;
&lt;h2 id="concurrenthashmap-jitter"&gt;ConcurrentHashMap &amp;amp; Jitter&lt;/h2&gt;
&lt;p&gt;With foreknowledge of the input data set, setting the map size appropriately (of course), is helpful in reducing 'jitter' on startup.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Wed, 12 Mar 2014 11:46:33 -0000</pubDate><guid>https://sourceforge.netf0c09cc0e217a9375337daa01e891d7e1d1adbf3</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="impl3-no-lock-implementation-asymptotic-behavior-and-gc"&gt;Impl3 - No Lock Implementation - Asymptotic behavior and GC&lt;/h2&gt;
&lt;p&gt;To better isolate the performance of the 'concurrentlinkedqueue' from background effects like&lt;br /&gt;
1) GC operations&lt;br /&gt;
2) map resizing events&lt;/p&gt;
&lt;p&gt;an additional test was performed with&lt;/p&gt;
&lt;p&gt;1) 300 Items (vs 100)&lt;br /&gt;
2) BidKeeper turned off &lt;br /&gt;
3) Heap/Eden/Survivor spaces all increased&lt;/p&gt;
&lt;p&gt;Adding more Items allows the test to probe for asymptotic behavior.  is the performance periodic?  Does it tail off monotonically down?&lt;/p&gt;
&lt;p&gt;Turning off the BidKeeper means there is very little interaction with any ConcurrenthHashMaps in the system; the performance then just reflects contentious read/write operations into the concurrent linked queue and the CAS operation.&lt;/p&gt;
&lt;p&gt;Adding more heap memory - and more memory to Eden and survivor spaces is an attempt at reducing the number of &lt;br /&gt;
1) Young generation collections - Parallel Scavance&lt;br /&gt;
2) Tenured space collection - parallel mark and sweep&lt;/p&gt;
&lt;h2 id="results"&gt;Results&lt;/h2&gt;
&lt;p&gt;Attached graphs show results performance and jitter given these settings.  The large spikes are identified as GC events (via VisualVM)&lt;/p&gt;
&lt;p&gt;As expected, the throughput goes up a bit peaking past 3M bids/sec.  The startup is less jittery.  GC events cause massive drops in performance.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;As expected, we need to keep at least 1 thread (and associated core) for doing GC work.&lt;br /&gt;
&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Wed, 12 Mar 2014 11:34:38 -0000</pubDate><guid>https://sourceforge.netfce341a5d3d30e0fef7a73a270d28b8a8def173c</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="test-settings"&gt;Test Settings&lt;/h2&gt;
&lt;hr /&gt;
&lt;h2 id="concurrent-hash-map"&gt;Concurrent Hash Map&lt;/h2&gt;
&lt;p&gt;Concurrent Hash Map 'concurrency level' was left at the default 16.&lt;br /&gt;
&lt;/p&gt;
&lt;h2 id="blocking-priority-queue"&gt;Blocking  Priority Queue&lt;/h2&gt;
&lt;p&gt;The queue uses a comparator to sort the bids.  The default size was used.&lt;/p&gt;
&lt;h2 id="gc"&gt;GC&lt;/h2&gt;
&lt;p&gt;The simulations were run in eclipse with the following JVM arguments&lt;/p&gt;
&lt;p&gt;-Xmx4096m  -javaagent:classmexer.jar -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:NewRatio=1 -XX:SurvivorRatio=6&lt;/p&gt;
&lt;p&gt;Eden space was made large - around 2 gig to avoid triggering a collection during any given simulation.  System.gc was called between collections.&lt;/p&gt;
&lt;p&gt;When triggered, the parallel collector operating on the Young collections (eden + survivor spaces) will run a Parallel Scavenge over Eden space - copying live objects over to one of the survivor spaces. &lt;/p&gt;
&lt;p&gt;Generally, it will identify live objects by starting with the application threads and identifying associated objects. &lt;/p&gt;
&lt;p&gt;Once complete, this GC operation leaves Eden 100% free.  Parallel Scavenge GC operation is done in non-application threads but is a 'stop the world' event e.g. the application threads are stopped.&lt;/p&gt;
&lt;p&gt;One can see 'dips' in performance on the attached charts for large number of client-Item scenarios - these are likely GC events.&lt;/p&gt;
&lt;p&gt;They are also possibly hashmap table resizes and or read/write locks being hit.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Tue, 11 Mar 2014 14:19:04 -0000</pubDate><guid>https://sourceforge.net8f067ce3f4e8172c52fc64731248b07a8fb4b79e</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="jitter-and-gapping"&gt;Jitter and Gapping&lt;/h2&gt;
&lt;p&gt;Impl3 uses two data sturctures&lt;br /&gt;
- concurrent hash map&lt;br /&gt;
- concurrent linked queue and CAS semantics on an atomic reference to keep track of 'peak bid' value&lt;/p&gt;
&lt;p&gt;the latter is a full 'no lock' implementation.  The former uses volatile, no lock read access if the hash maps directly to an element, else, it read locks the segment and searches for the element in the bucket.&lt;/p&gt;
&lt;p&gt;the writes are lock protected.&lt;/p&gt;
&lt;p&gt;This implementation is most sensitive to any thread blocking, starvation issues (since it doesn't benefit from any statistics which would blur the effect).&lt;/p&gt;
&lt;p&gt;Attached are plots of Throughput and Jitter for different initial capacity settings of the concurrent hash map: 16, 1k, 1M.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The plots show performance and jitter are both reduced as the initial capacity is increased and intermittent map resizing is reduced.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Mon, 10 Mar 2014 15:02:42 -0000</pubDate><guid>https://sourceforge.netd3855a953925aa711e1ef8ecd8a04eedbcd04464</guid></item><item><title>Home modified by chris fabri</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,6 +1,8 @@
 Welcome to your wiki!

 This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+
+[Test Settings]

 The wiki uses [Markdown](/p/elise-ebay/wiki/markdown_syntax/) syntax.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Sat, 08 Mar 2014 11:51:41 -0000</pubDate><guid>https://sourceforge.netf546371d47828d58287e0949a958dbd7a2917c39</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="test-settings"&gt;Test Settings&lt;/h2&gt;
&lt;hr /&gt;
&lt;h2 id="concurrent-hash-map"&gt;Concurrent Hash Map&lt;/h2&gt;
&lt;p&gt;Concurrent Hash Map 'concurrency level' was left at the default 16.&lt;br /&gt;
&lt;/p&gt;
&lt;h2 id="blocking-priority-queue"&gt;Blocking  Priority Queue&lt;/h2&gt;
&lt;p&gt;The queue uses a comparator to sort the bids.  The default size was used.&lt;/p&gt;
&lt;h2 id="blocking-priority-bag"&gt;Blocking Priority Bag&lt;/h2&gt;
&lt;p&gt;Of course, we don't fully need a priority queue for this implementation.  If one can assume that any added bids are rarely removed from the queue, then, t's only necessary to check any new bid against the current 'best' or 'max' bid, swap them if necessary, which operation is really just O(1).&lt;/p&gt;
&lt;h2 id="gc"&gt;GC&lt;/h2&gt;
&lt;p&gt;The simulations were run in eclipse with the following JVM arguments&lt;/p&gt;
&lt;p&gt;-Xmx4096m  -javaagent:classmexer.jar -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:NewRatio=1 -XX:SurvivorRatio=6&lt;/p&gt;
&lt;p&gt;Eden space was made large - around 2 gig to avoid triggering a collection during any given simulation.  System.gc was called between collections.&lt;/p&gt;
&lt;p&gt;When triggered, the parallel collector operating on the Young collections (eden + survivor spaces) will run a Parallel Scavenge over Eden space - copying live objects over to one of the survivor spaces. &lt;/p&gt;
&lt;p&gt;Generally, it will identify live objects by starting with the application threads and identifying associated objects. &lt;/p&gt;
&lt;p&gt;Once complete, this GC operation leaves Eden 100% free.  Parallel Scavenge GC operation is done in non-application threads but is a 'stop the world' event e.g. the application threads are stopped.&lt;/p&gt;
&lt;p&gt;One can see 'dips' in performance on the attached charts for large number of client-Item scenarios - these are likely GC events.&lt;/p&gt;
&lt;p&gt;They are also possibly hashmap table resizes and or read/write locks being hit.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Sat, 08 Mar 2014 11:43:56 -0000</pubDate><guid>https://sourceforge.net6c43205c93c1274409b2beacc4535292e5c93859</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="better-performance-priority-bag"&gt;Better Performance - 'priority bag'&lt;/h2&gt;
&lt;p&gt;The main slowdown in the system is inserting Items into the blocking priority queue.  This operations is klog(k) with k=number of Bids in the queue.&lt;/p&gt;
&lt;p&gt;We don't need a fully sorted 'tree' of Bids however - we only need to keep track of the best bid.  As such, we can implement a 'priority bag'; this bag keeps track of the highest value its seen but doesn't sort or order the items past the max value.&lt;/p&gt;
&lt;p&gt;Peak performance with this custom priority bag was 2.5M bids/sec - that's 45% better than the peak of 1.7M bids/sec using the blocking priority queue.&lt;/p&gt;
&lt;p&gt;As before, the peak throughput occurred when using 4 clients (and hence 4 threads).  As expected, the peak throughput occured with 4 threads since the test was run on a 4 core single CPU machine&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Fri, 07 Mar 2014 14:36:06 -0000</pubDate><guid>https://sourceforge.net7f4a671518291926ff5eee5aa71c8a0da52bacd6</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="deterministic-performance-thread-jitter"&gt;Deterministic Performance  thread jitter&lt;/h2&gt;
&lt;p&gt;One of the hallmarks of 'no lock' coding is that performance is more deterministic.  Given identical input conditions, the time taken to execute a given scenario stays constant.&lt;/p&gt;
&lt;p&gt;We can quantify this measure by doing some stats on the times associated with each thread of execution.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Basically, the threads were 100% deterministic, the times for each thread would be the same.  hence, the stdDeviation of the times / times gives us a good measure.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Thu, 06 Mar 2014 19:01:22 -0000</pubDate><guid>https://sourceforge.netc46c73f23ea978ef5a39bf5aff4c7d7f129293a2</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;img alt="Bids vs Clients" src="https://sourceforge.net/p/elise-ebay/screenshot/Bids%20vs%20Clients2.png" /&gt;&lt;/p&gt;
&lt;h2 id="bids-vs-clients"&gt;Bids vs Clients&lt;/h2&gt;
&lt;p&gt;for a fixed number of items, what happens as we add more clients?&lt;/p&gt;
&lt;p&gt;The graph shows that the throughput peaks as the client count matches the core count - then stays constant as we add more clients. &lt;/p&gt;
&lt;p&gt;The fact that the throughput stays constant as we add more clients is a reflection of 'no lock' read/writes across a well distributed set of buckets in the concurrent hash map.&lt;/p&gt;
&lt;p&gt;The dips on the 32 client plot is likely GC execution.&lt;/p&gt;
&lt;h2 id="bids-vs-items"&gt;Bids vs Items&lt;/h2&gt;
&lt;p&gt;For a fixed number of clients, what happens as we add more items?&lt;/p&gt;
&lt;p&gt;The graph shows that the throughput peaks for client count matching the core count - around 4-5 clients - staying very similar as we add more clients.  The plot of 3 clients is basically the same as the plot of 32 clients.  Adding 10x the clients doesn't change the throughput plot at all.&lt;/p&gt;
&lt;p&gt;The fact that the throughput plots stay basically the same as we add more clients past 3 is a reflection of 'no lock' read/writes across a well distributed set of buckets in the concurrent hash map.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Thu, 06 Mar 2014 14:42:35 -0000</pubDate><guid>https://sourceforge.netdd9efb816b5343fddf1cda872239a266ad6230ec</guid></item><item><title>Discussion for Home page</title><link>https://sourceforge.net/p/elise-ebay/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;img alt="alternate text" src="https://sourceforge.net/p/elise-ebay/screenshot/ebay%20system%20entity%20diagram.png" /&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chris fabri</dc:creator><pubDate>Thu, 06 Mar 2014 10:41:08 -0000</pubDate><guid>https://sourceforge.neta684e0a79045039cae2b76715c5f61e133ad8f2d</guid></item></channel></rss>