Postgres default max connection is set to 100.

https://www.postgresql.org/docs/9.5/static/runtime-config-connection.html

max_connections (integer)

Determines the maximum number of concurrent connections to the database 
server. The default is typically 100 connections, but might be less if your 
kernel settings will not support it (as determined during initdb). This 
parameter can only be set at server start.

When running a standby server, you must set this parameter to the same or 
higher value than on the master server. Otherwise, queries will not be 
allowed in the standby server.



Il giorno venerdì 30 giugno 2017 20:40:36 UTC+2, Gerald Stan ha scritto:
>
> what you want is to set SetMaxOpenConns, SetMaxIdleConns:
>
> db, err := sql.Open(config.DriverName, GetDataSourceFromConfig(config))
> if err != nil {
> log.Fatal(err)
> }
>
> db.SetMaxOpenConns(config.MaxOpenConns)
> db.SetMaxIdleConns(config.MaxIdleConns)
>
>
> On Friday, June 30, 2017 at 10:22:11 AM UTC-4, Franco Marchesini wrote:
>>
>> If you really have over 100 simultaneous connection you need to configure 
>> postgresql engine
>> Regards
>> Franco
>>
>> Il giorno mercoledì 21 giugno 2017 14:56:14 UTC+2, Tieson Molly ha 
>> scritto:
>>>
>>> I am running into an issue I have seen mentioned on here years ago.  I 
>>> am seeking the current best solution.
>>>
>>> I have a web server connecting to a postgresql database using the 
>>> standard database/sql and the lib/pq driver.  I keep running out of 
>>> connections over time as it seems the pool grows up to 100.
>>>
>>> Is there a way to prevent or fix this?
>>>
>>> Best regards,
>>>
>>> Ty
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to