<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 6, 2016 at 6:16 AM, Jan Wieck <span dir="ltr"><<a href="mailto:jan@wi3ck.info" target="_blank">jan@wi3ck.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">How are you monitoring the number of rows in the sl_log_* tables?<div><br></div><div><br></div><div>Jan</div></div><div class="gmail_extra"><br></div></blockquote><div><br></div><div>I've got a couple of updates but first let me answer the question.</div><div><br></div><div><p class=""><span class=""> </span><span class="">max</span><span class=""> => </span><span class="">"SHOW max_connections"</span><span class="">,</span></p><p class=""><span class=""> </span><span class="">cur</span><span class=""> => </span><span class="">"SELECT COUNT(*) FROM pg_stat_activity"</span><span class="">,</span></p><p class=""><span class=""> </span><span class="">log1</span><span class=""> => </span><span class="">"SELECT COUNT(*) FROM _cls.</span><span class="">sl_log</span><span class="">_1"</span><span class="">,</span></p><p class=""><span class=""> </span><span class="">log2</span><span class=""> => </span><span class="">"SELECT COUNT(*) FROM _cls.</span><span class="">sl_log</span><span class="">_2"</span><span class="">,</span></p><p class=""><span class=""> </span><span class="">siz1</span><span class=""> => </span><span class="">"SELECT (relpages*8) FROM pg_class where relname='</span><span class="">sl_log</span><span class="">_1'"</span><span class="">,</span></p><div><span class=""> </span><span class="">siz2</span><span class=""> => </span><span class="">"SELECT (relpages*8) FROM pg_class where relname='</span><span class="">sl_log</span><span class="">_2'"</span> </div><div><br></div><div>We have a script that runs and monitors a few things in the dB, one is the count of sl_log_1 and 2. This is added as an RRD </div><div>and graphed. </div><div><br></div><div>Now the update, graph above , is what we have been seeing, logs grow up until 10:50am or so when the truncate is allowed (now backups are complete at 4am and all heavy lifting is finished at 5am)</div><div><br></div></div><div><br></div><div><img class="graphimage" id="graph_3562" src="http://adm-ops.eng.admission.net/cacti/graph_image.php?local_graph_id=3562&rra_id=0&graph_height=120&graph_width=500&title_font_size=10&view_type=tree&graph_start=1470093955&graph_end=1470466429" border="0" alt="idb01.gc - slonyTables" width="447" height="205" style="margin-right: 0px;"><br></div><div><br></div><div><br></div><div>I disabled the full backup on the standby unit last night.</div><div><img class="" id="graph_3562" src="http://adm-ops.eng.admission.net/cacti/graph_image.php?local_graph_id=3562&rra_id=0&graph_height=120&graph_width=500&title_font_size=10&view_type=tree&graph_start=1470673657&graph_end=1470760057" border="0" alt="idb01.gc - slonyTables" width="450" height="207" style="margin-right: 0px;"><br></div>
<p class=""><br></p><div>I still get some peeks and valleys, but the system is not backed up for 10 hours. So this tells me that the backup on the standby is causing a situation where slon is blocked because tables are locked on the standby unit. This is still not ideal but it's a big improvement from before where the sl_log_? would grow to 14million rows from about 2am to 10:45am..</div><div><br></div><div>So I need to figure out how to reduce the overhead of the backup, I figured it was better to run it on the standby but at this point that is not looking like a great option..</div><div><br></div><div>Thanks for working on this with me!</div><div><br></div><div>Tory</div></div></div></div>