<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>Yes, you can limit the nr of CPU cores that render in QGIS - and this will limit the PG connections.</p>
<p>Menu "Settings" --> "Options" --> "Rendering".</p>
<p>If you disable the checkbox "Render layers in parallel using many CPU cores", this will force QGIS to go single threaded for drawing - or you can use the setting to the right of it and set it to use max 2 CPU cores, which will restrict it to two connectsions max.</p>
<p>The much better solution, however, would be to use a connection pool solution (like pgBouncer). Then the idle connections will be temporarily disconnected from the PG server. See the pgBouncer documentation.</p>
<p>Greetings,</p>
<p>Andreas</p>
<p id="reply-intro">On 2022-03-09 12:23, Mauricio Vieira Cardoso Filho via Qgis-user wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div>
<div dir="ltr">Hi Alexandre, 
<div>Thanks for the answer. Is there any way to prevent this from happening? - I ask because I have many users who connect to the postgres database through QGIS and for each user connection, it is generating five connection sessions in the database. And that has killed Postgres's performance. Is there a way to prevent QGIS from generating this amount of connections?</div>
<div> </div>
<div>Best Regards</div>
<div><br clear="all" />
<div>
<div class="v1gmail_signature" dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr"><span style="color: #0b5394; font-family: tahoma, sans-serif; font-size: small;">Maurício Vieira Cardoso Filho<br />Gerente TI Infra<br />Tel: +556137995051<br />email : <a href="mailto:mcardoso@topocart.com.br" rel="noreferrer">mcardoso@topocart.com.br</a>;<br />skype: mauricio.cardoso1974</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">Em ter., 8 de mar. de 2022 às 23:36, Alexandre Neto <<a href="mailto:senhor.neto@gmail.com" rel="noreferrer">senhor.neto@gmail.com</a>> escreveu:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div dir="auto">Hello Mauricio,
<div dir="auto"> </div>
<div dir="auto">That is "normal". Several different components of QGIS can establish different and independent connections to PostgreSQL. For example, the browser panel can create a connection, the database manager another, and so on.</div>
<div dir="auto"> </div>
<div dir="auto">Alexandre Neto</div>
</div>
<br />
<div class="v1gmail_quote">
<div class="v1gmail_attr" dir="ltr">A terça, 8/03/2022, 20:14, Mauricio Vieira Cardoso Filho via Qgis-user <<a href="mailto:qgis-user@lists.osgeo.org" rel="noreferrer">qgis-user@lists.osgeo.org</a>> escreveu:</div>
<blockquote class="v1gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div dir="ltr">I use QGIS 3.16 and I'm having an operation that I believe to be abnormal. I use QGIS connected to a postgres database. My problem is that QGIS is creating five simultaneous connections for each database user. (For example, when opening qgis and connecting to the bank, on my server I have five connections created with my username). Does anyone have any idea what could be happening?
<div> </div>
<div>Best<br clear="all" />
<div>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr"><span style="color: #0b5394; font-family: tahoma, sans-serif; font-size: small;">Maurício Vieira Cardoso Filho<br />Gerente TI Infra<br />Tel: +556137995051<br />email : <a href="mailto:mcardoso@topocart.com.br" rel="noreferrer">mcardoso@topocart.com.br</a>;<br />skype: mauricio.cardoso1974</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br />Qgis-user mailing list<br /><a href="mailto:Qgis-user@lists.osgeo.org" rel="noreferrer">Qgis-user@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote>
</div>
</blockquote>
</div>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />Qgis-user mailing list<br /><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank" rel="noopener noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
</blockquote>
<p><br /></p>

</body></html>