<p>Well postgresql can be tuned to handle more connections as well. but decreasing the timeouts should do it</p>
<div class="gmail_quote">On May 12, 2012 10:10 AM, "Brown, Rodrick" <<a href="mailto:rbrown@knight.com">rbrown@knight.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This might seem like a stretch but another alternative may be to moving to the Oracle-XE version which can support a lot more convections than postgres.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.com</a> [mailto:<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.com</a>]
<b>On Behalf Of </b>Paul Robert Marino<br>
<b>Sent:</b> Friday, May 11, 2012 6:56 PM<br>
<b>To:</b> <a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a><br>
<b>Subject:</b> Re: [Spacewalk-list] Spacewalk 1.7 Postgres out of connections<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p>Well I've worked around it by reducing the tcp heartbeat to 10 minutes in /etc/sysctl.conf and reducing the idle client timeout in postgresqls configuration.<br>
But yes there is an issue with this.<br>
I think it the monitoring that does it but I'm not sure. I can tell you the incidents of it do go up with monitoring turned on.<br>
The problem is is seems like its a shared library that isn't logging if the class goes out of scope out of the database correctly that make tracking the root cause significantly harder.<br>
I'm not familiar enough with python to figure explain how it should be fixed but in perl the DBI driver had. DESTROY method that catches if the programer forgot to logout of the database before the instance of the class goes out of scope or the application
 exits. It seems to me this is missing from the python postgresql driver and if that functionality could be added it would resolve the issue.<u></u><u></u></p>
<div>
<p class="MsoNormal">On May 11, 2012 6:13 PM, "Scott Piazza" <<a href="mailto:scott.piazza@bespokess.com" target="_blank">scott.piazza@bespokess.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">I recently upgraded from Spacewalk 1.6 to 1.7.  In this version, I am<br>
seeing an issue where Spacewalk works fine for several hours, but then<br>
the database runs out of connections, and Spacewalk begins throwing<br>
errors.  Similar Postgresql errors on other forums try to blame the<br>
application for not closing connections correctly.  Older Spacewalk<br>
posts online seem to suggest there's an issue with osa-dispatcher that<br>
might be causing it.  I have disabled osa-dispatcher for now and am<br>
waiting to see if that helps narrow down the source of the problem.<br>
However, if anyone has additional suggestions to get this fixed, I would<br>
appreciate hearing them.<br>
<br>
<br>
Server: CentOS 6.2<br>
Spacwalk: 1.7<br>
SELinux: off<br>
PostgreSQL: 8.4.9-1.el6_1.1<br>
Postgres max connections: 500<br>
<br>
/var/log/rhn/rhn_server_xmlrpc.log:<br>
2012/05/10 12:17:50 -07:00 29438 <a href="http://10.0.11.2" target="_blank">10.0.11.2</a>:<br>
rhnSQL/driver_postgresql.check_connection('ERROR', "DATABASE CONNECTION<br>
TO 'whmgmt' LOST", "Exception information: Database instance has no<br>
attribute 'dbh'")<br>
<br>
/var/log/rhn/osa-dispatcher.log:<br>
2012/05/10 08:14:09 -07:00 10255 <a href="http://0.0.0.0" target="_blank">0.0.0.0</a>:<br>
rhnSQL/driver_postgresql.check_connection('ERROR', "DATABASE CONNECTION<br>
TO 'whmgmt' LOST", 'Exception information: server closed the connection<br>
unexpectedly\n\tThis probably means the server terminated abnormally\n<br>
\tbefore or while processing the request.\n')<br>
<br>
/var/lib/pgsql/data/pg_log/logfile.log:<br>
2012-05-10 17:50:47 MST - whmgmtuser - [local]: FATAL:  sorry, too many<br>
clients already<br>
2012-05-10 17:50:49 MST - whmgmtuser - <a href="http://127.0.0.1" target="_blank">
127.0.0.1</a>: LOG:  unexpected EOF<br>
on client connection<br>
2012-05-10 17:51:13 MST - whmgmtuser - [local]: LOG:  could not send<br>
data to client: Broken pipe<br>
<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><u></u><u></u></p>
</div>
</div>
<br>
<font face="Arial" color="Blue" size="1">Please visit our website for important disclaimers/disclosures regarding Knight’s products and services:<br>
<br>
<a href="http://knight.com/KnightEmailDisclaimer.html" target="_blank">http://knight.com/KnightEmailDisclaimer.html</a><br>
<br>
</font>
</div>

<br>_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br></blockquote></div>