<div dir="ltr">No worries,  yeah, I&#39;ve pretty much resigned myself to doing a vacuum/reindex 2 or 3 times a month.   I&#39;m fairly convinced that the deadlocks I&#39;ve found are happening around RHN errata, and there&#39;s only one repo that&#39;s importing errata, but I haven&#39;t figured out how to disable that function.  I&#39;ve gone as far as chatting with some of the DBA&#39;s who work here in other functions.  They&#39;re not as afraid of deadlocks as I am, but they also have access to the queries/code, and since it&#39;s basically an open-source implementation of satellite and I&#39;m not a DBA, that&#39;s not going to happen.  So really my only choice is to patch it, but it (the system), is a relatively delicate single point of failure in this environment, so I really don&#39;t want to stick my hand in that bee-hive if I can help it.   It&#39;d be easier to try and get more storage for the NFS share it runs on, but of course, the problem with that logic, is I have no idea if there&#39;s a cap on how much space it will eat.   For all I know it will keep growing ad-infinitum.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 12, 2016 at 11:20 AM, Chris Fedde <span dir="ltr">&lt;<a href="mailto:chris@fedde.us" target="_blank">chris@fedde.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I know that this one is getting kind of old but I thought I&#39;d chime in anyway.  You can ask postgresql to log the queries it is running.<div>It might be worth reviewing <a href="https://www.postgresql.org/docs/8.4/static/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT" target="_blank">https://www.<wbr>postgresql.org/docs/8.4/<wbr>static/runtime-config-logging.<wbr>html#RUNTIME-CONFIG-LOGGING-<wbr>WHAT</a> as a step along the way.</div><div>Of interest might be the &#39;log_statement&#39;</div><div><br></div><div>Also the freenode#postgresql irc channel has been very helpful to me in the past.</div><div><br></div><div>Good luck!</div><span class="HOEnZb"><font color="#888888"><div>chris</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 7, 2016 at 8:37 AM, Quentin Hartman <span dir="ltr">&lt;<a href="mailto:qhartman@gmail.com" target="_blank">qhartman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry to hear that. Such is the life of us Internet janitors, always cleaning up someone else&#39;s spilled lunch...<br></div><div class="m_-6451900427628926376HOEnZb"><div class="m_-6451900427628926376h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 2:13 PM, Mike Bean <span dir="ltr">&lt;<a href="mailto:beandaemon@gmail.com" target="_blank">beandaemon@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yeah, tell me about it.   Problem is just to make things super interesting there is way too much of the network with fish-hooks into thing, it&#39;s not easy to patch.  Apparently the term &quot;single point of failure&quot; - wasn&#39;t thoroughly considered when designing/implementing this environment.   I just recently met a DBA at my company, asked their opinion.   After answering some questions we arrived at basically the same conclusion.  If you can&#39;t get into the code and look at the actual queries, your only real practical option is to patch it; which I definitely cannot do easily.  (sigh)<div><br></div></div><div class="m_-6451900427628926376m_-8635807529514521207HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 1:50 PM, Quentin Hartman <span dir="ltr">&lt;<a href="mailto:qhartman@gmail.com" target="_blank">qhartman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I should add that there have been some pretty massive improvements to postgres since 8.4, and it wouldn&#39;t be at all surprising if your problem just disappeared after an upgrade.<span class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920HOEnZb"><font color="#888888">QH<br></font></span></div><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 1:48 PM, Quentin Hartman <span dir="ltr">&lt;<a href="mailto:qhartman@gmail.com" target="_blank">qhartman@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Oof, 8.4, that&#39;s tough. It&#39;s been long enough since I touched an 8.x box, I&#39;m not sure off hand. It should be in the main conf though. Here&#39;s what should be the relevant section i nthe official docs: <a href="https://www.postgresql.org/docs/8.4/static/runtime-config-logging.html" target="_blank">https://www.postgresql.org/doc<wbr>s/8.4/static/runtime-config-lo<wbr>gging.html</a><br><br></div>As an aside, that&#39;s not a supported version anymore. Unless you have a compelling reason not to, upgrading to a 9.2+ (9.6 is current) should be at or near the top of your to-do list...<span class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803HOEnZb"><font color="#888888">QH <br></font></span></div><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 1:41 PM, Mike Bean <span dir="ltr">&lt;<a href="mailto:beandaemon@gmail.com" target="_blank">beandaemon@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It&#39;s 8.4  - unfortunately we&#39;re having some problems with autovacum appearing to be configured correctly, not realistically running when it should<div><br></div><div>POSTGRES_LAST_AUTOVACUUM CRITICAL: DB &quot;xe&quot; (host:localhost) (port=1935) DB: xe TABLE: pg_catalog.pg_class: 17:11 November 18, 2016 (16 days 20 hours 23 minutes)<br></div><div><br></div><div>the thursday log is largely full of checkpoint_segments spam, and ONE deadlock condition:</div><div><br></div><div><div>DETAIL:  Process 9758 waits for ShareLock on transaction 40741339; blocked by process 9794.</div><div>        Process 9794 waits for ShareLock on transaction 40740891; blocked by process 9758.</div><div>        Process 9758: select * from rhn_channel.update_needed_cach<wbr>e($1) as result</div><div>        Process 9794:</div></div><div><br></div><div>there hasn&#39;t been much in the way of logging since the deadlock, just more checkpoint_segment spam</div><div><div>HINT:  Consider increasing the configuration parameter &quot;checkpoint_segments&quot;.</div><div>LOG:  checkpoints are occurring too frequently (16 seconds apart)</div></div><div><br></div><div>Since as near as I can tell the only meaningful logging over the last 4 days is the deadlock, I&#39;m inclined to think the deadlock has some relationship with the DB growing 40GB over the weekend.    Quentin&#39;s probably right, I probably need to turn up the logging levels.  Do we know where those are?  in the .conf file?</div></div><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 11:06 AM, Grant Johnson <span dir="ltr">&lt;<a href="mailto:grant@amadensor.com" target="_blank">grant@amadensor.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There is a good chance that the Thursday log holds some clues about what<br>
the activity was.    It is likely repeated often, and will be easy to<br>
find, as it was happening a lot.   If the volume was very high, you also<br>
see messages about checkpoints, because changes were out pacing the<br>
normal background DB writes.  If these were happening only during this<br>
anomalous time, I would not worry about it, but if it happens during<br>
normal operations, some tuning changes may be needed.<br>
<br>
If you are having updates that exceed your free space map, the normal<br>
vacuum will not release the space, and instead you will need to run a<br>
vacuum full, which has the unfortunate side effect of locking tables<br>
while it runs, so it impedes write operations.<br>
<br>
So, I would look at the log, see if anything starts making sense, and<br>
then clean up with a full vacuum during a low activity time, and perhaps<br>
a reindex all.   I have found that doing full clean up every year or so<br>
helps, but generally, leaving the free space in the files with normal<br>
vacuum/auto-vacuum helps performance.<br>
<div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994m_6392774321791334606HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994m_6392774321791334606h5"><br>
<br>
On Mon, 2016-12-05 at 07:47 -0700, Mike Bean wrote:<br>
&gt; Of particular interest is<br>
&gt;<br>
&gt;<br>
&gt; -rw-------  1 postgres postgres  94479 Dec  2 21:29 postgresql-Fri.log<br>
&gt; -rw-------  1 postgres postgres      0 Dec  5 00:00 postgresql-Mon.log<br>
&gt; -rw-------  1 postgres postgres      0 Dec  3 00:00 postgresql-Sat.log<br>
&gt; -rw-------  1 postgres postgres      0 Dec  4 00:00 postgresql-Sun.log<br>
&gt; -rw-------  1 postgres postgres 208184 Dec  1 23:59 postgresql-Thu.log<br>
&gt; -rw-------  1 postgres postgres  86154 Nov 29 21:57 postgresql-Tue.log<br>
&gt; -rw-------  1 postgres postgres  89399 Nov 30 21:48 postgresql-Wed.log<br>
&gt;<br>
&gt;<br>
&gt; Huh - want to bet the writes were actually on thursday?    The plot<br>
&gt; thickens!<br>
&gt;<br>
&gt; On Mon, Dec 5, 2016 at 7:43 AM, Mike Bean &lt;<a href="mailto:beandaemon@gmail.com" target="_blank">beandaemon@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;         Do we have members who are comfortable/skilled with postgres?<br>
&gt;         Long story short we have a spacewalk server running<br>
&gt;         postgres and the DB is showing really erratic behavior.  We<br>
&gt;         used to do weekly vacuums to keep it from running out of<br>
&gt;         space, I figured out that doing a reindex bumped the free<br>
&gt;         space from 20-80 GB.  Over the weekend, it dropped to roughly<br>
&gt;         60, we went one week without doing a vacuum reindex, and it&#39;s<br>
&gt;         back down to 20.<br>
&gt;<br>
&gt;<br>
&gt;         I know for a fact there&#39;s no one else in the organization<br>
&gt;         making major changes on this DB, and certainly nothing that<br>
&gt;         could justify 40GB of writes in 3 days.  Not really being a<br>
&gt;         DBA, I&#39;m running low on my bag of tricks, thought I&#39;d see if<br>
&gt;         CLUE had any advice.   Running vacuums once a week to keep it<br>
&gt;         from filling the disk feels like taking aspirin to get over<br>
&gt;         your gunshot wound.  Sure, it&#39;ll keep the server running, but<br>
&gt;         ultimately what I really want to know is why a largely static<br>
&gt;         spacewalk DB is writing 60GB to the disk in a 2 week interval.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994m_6392774321791334606HOEnZb"><div class="m_-6451900427628926376m_-8635807529514521207m_-6502176060456402920m_8131589494932958803m_-8362780188321382994m_6392774321791334606h5">&gt; ______________________________<wbr>_________________<br>
&gt; clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
&gt; For information, account preferences, or to unsubscribe see:<br>
&gt; <a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" rel="noreferrer" target="_blank">http://cluedenver.org/mailman/<wbr>listinfo/clue</a><br></blockquote></div><br></div>