<div dir="ltr">Buildbot <0.9.3 did compress the whole log at once inside a transaction. I can imagine this taking very long with 100% CPU.</div><div dir="ltr"><br></div><span>
</span><br><div class="gmail_quote"><div dir="ltr">Le mer. 1 févr. 2017 18:12, Francesco Di Mizio <<a href="mailto:francescodimizio@gmail.com">francescodimizio@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hey Pierre,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">what I noticed is that the query does not take long at all when I run it myself.</div><div class="gmail_msg">When it is issued through buildbot the state though, it is in a 'idle in transaction' state, which seems to be something bad according to many blogs on the web. As if bbot is waiting for postgres to do something but postgres isnt actually doing anything.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Will give 9.3 but at this point I doubt it'll help.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks!</div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Wed, Feb 1, 2017 at 4:56 PM, Pierre Tardy <span dir="ltr" class="gmail_msg"><<a href="mailto:tardyp@gmail.com" class="gmail_msg" target="_blank">tardyp@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><span class="gmail_msg"><div dir="ltr" class="gmail_msg">Le lun. 30 janv. 2017 à 17:49, Francesco Di Mizio <<a href="mailto:francescodimizio@gmail.com" class="gmail_msg" target="_blank">francescodimizio@gmail.com</a>> a écrit :<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg">Digging this up again. Havent moved to a physical server yet. I will first be splitting the bbot server and postgres on different hosts.<div class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg"><br class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg"></div><div class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg">What I've noticed the CPU spiking is always (and I rea) due to queries like:</div><div class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg">SELECT logchunks.first_line, logchunks.last_line, logchunks.content, logchunks.compressed FROM logchunks WHERE logchunks.logid = 56343 ORDER BY logchunks.first_line<br class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg"></div><div class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg"><br class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg"></div><div class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg">If I am correct that call can only come from <a href="https://github.com/buildbot/buildbot/blob/cfe60e31206748bcf01232eb13c0d6177cd04d5d/master/buildbot/db/logs.py#L252" class="m_-7945858902710697471m_1043758075487057639gmail_msg gmail_msg" target="_blank">CompressLog</a> . They do take a very long time (even 1 minute). While running all the system is stuck. I wonder if I should use some custom postgres config, I am simply running the official postgres 9.5 container. </div></div></blockquote></span><div class="gmail_msg">Hi Francesco,</div><div class="gmail_msg">If your logs are not anormally large, like you said already this should not take one minute.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">That said, I have released in 0.9.3 an optimization that removes that particular request so that the compression happens on a stream of smaller requests.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">You might consider an upgrade in order to see if the situation improves.</div><span class="m_-7945858902710697471HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Pierre</div></font></span></div></div>
</blockquote></div><br class="gmail_msg"></div>
</blockquote></div>