<html><head></head><body>Hi Karl,<br /><br />Thank you for the quick response!&nbsp; I'll digest what you've written and apply it to my situation and see how things go.&nbsp; Your answers were very clear and straight-forward, which is a great help.<br /><br />-Michel<br /><br /><hr /><strong>From: </strong><span title="schendel@kbcomputer.com">&quot;Karl and Betty Schendel&quot; &lt;schendel@kbcomputer.com&gt;</span><br /><strong>Date: </strong>Thu, Jan 4, 2018 3:30 pm<br /><strong>To: </strong><span title="info-ingres@lists.planetingres.org">&quot;Ingres and related product discussion forum&quot; &lt;info-ingres@lists.planetingres.org&gt;</span><br /><strong>Subject: </strong>Re: [Info-ingres] Effective Ingres Caching<br />
<article><br />&gt; On Jan 4, 2018, at 5:03 PM, Michel Forget &lt;mvf@cyberren.com&gt; wrote:<br />&gt; <br />&gt; Hi,<br />&gt; <br />&gt; I'm looking for some advice on cache sizes in Ingres.<br />&gt; [snip]<br />&gt; So, some specific questions I am hoping to find answers to:<br />&gt; <br />&gt; 1. &nbsp; Is increasing dmf_cache_size the correct approach toward the goal of consuming more memory and increasing overall read performance by not having to hit the physical disk?<br /><br />Yes, up to a point. &nbsp; dmf_cache_size only affects the single-page area, and one may<br />also want to add group buffers; dmf_group_size to make them larger and dmf_group_count<br />to add more of them. &nbsp; The &quot;right&quot; group size depends on usage patterns, but in general<br />I'd try to adjust it so that groups work out to anywhere between 64k and 512k. &nbsp; I would<br />generally not go much larger because the penalty for tossing a group becomes very high,<br />and group!
  management is not coded with large (100's of pages) groups in mind.<br /><br />&gt; 2. &nbsp; Are there negative consequences to setting this value too high?<br /><br />Absolutely. &nbsp; The cache algorithms and code were written with cache size of a<br />few-thousand to few-tens-of-thousand pages in mind. &nbsp; It was never optimized for many<br />tens-of-thousands and up. &nbsp; (The code is better at large caches than it used to be,<br />back in the version 2.x and earlier days, but it's still not good at huge numbers of pages.)<br /><br />Part of the reason for this is that Ingres takes advantage of another cache which you<br />aren't seeing directly, and that's the filesystem cache. &nbsp; Ingres doesn't use raw or<br />direct I/O, unless you tell it to. &nbsp; My rough rule of thumb is to set the cache size so that<br />it's in the few-tens-of-thousands of pages range, and a few thousand groups,<br />and let the OS filesystem cache do the rest. &nbsp; The filesyste!
 m cache is generally better<br />designed for using up many gigabytes of memory.<br /><br />(This isn't conventional DBMS wisdom, but conventional DBMS wisdom also assumes<br />either raw/direct I/O, or massive tablespaces where the underlying table structure is<br />hidden from the OS filesystem. &nbsp; Ingres never did it that way, and it can use the filesystem<br />cache a lot more effectively because of it.)<br /><br /><br />&gt; 3. &nbsp; I've noticed that the output of &quot;help table sometable;&quot; shows a field called &quot;cac! he priority&quot;. &nbsp; If I know which of my tables I consider to be most cache-worthy, can I use this setting to purposely bias the cache in favor of the tables I care about? &nbsp; If so, how can I do that? &nbsp; I've never seen anything that indicates how I could set this. <br /><br />modify tablename to priority=N<br />or modify tablename to &lt;structure&gt; with priority=N<br />N can be 1 to 8 (low to high).<br /><br />You have to be pretty careful with this. &nbsp; I personally don't think the imp!
 lementation of this<br />feature was as good as it should have been. &nbsp; I'd use it sparingly and on smallish tables. &nbsp; Also, I<br />suspect that the only useful value is 8; &nbsp; I don't think you'll get much good out of setting a table's<br />cache priority to (say) 2 or 3.<br /><br />&gt; 4. &nbsp; I realize this is super-general, but what do people generally consider &quot;good&quot; cache hit rates? &nbsp; I mean, if I keep throwing more memory at the cache can I reasonably expect to drive cache hit rates up to values approaching 100% (ie: if the cache were larger than the actual database itself)?<br /><br />Again, very very rough rule of thumb, but above 90% is usually more or less OK, while below<br />90% needs some thought. &nbsp; Below say 60% needs some real 'splainin; &nbsp; it might in fact be<br />the best one can do given some usage patterns, so it's not an automatic &quot;make the cache<br />bigger&quot;. &nbsp; Also, remember that hit rates aren't e!
 verything, a 90% hit rate is no good if the<br />cache has become so bloated that every reclaim/replace takes milliseconds of CPU time.<br /><br />By the way, I don't think you'll ever hit 100% because of the way it handles core catalogs.<br />I haven't experimented, and I could be wrong, but I'd be surprised to see a pure 100%<br />cache hit rate except under artificial circumstances such as no DDL, read-mostly load,<br />and either no session connects or all databases (including iidbdb) pinned open for the duration.<br /><br />Karl<br /><br />_______________________________________________<br />Info-ingres mailing list<br />Info-ingres@lists.planetingres.org<br />http://lists.planetingres.org/mailman/listinfo/info-ingres</article></body></html>