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