SQLSTATE[08006] [7] FATAL: sorry, too many clients already

Hi,

Hi have an error about connections to DB :

PDOException: SQLSTATE[08006] [7] FATAL: sorry, too many clients already
FATAL: sorry, too many clients already

As it says, I think there is a problem with too many connections to DB.
How can I manage to solve this ? Is there a way to add more available
slots ? Or to somehow “kill” processes so they no more uses those slots ?

Thanks !

Regards

Finally found the solution.
The problem was the max_connections parameter of postgresql (default value is 100). I needed more than 100 for my tests.

Hence, I edited the config file (set to 300 for instance) this way :

test:
    pre:
        - sudo sed -i 's/max_connections = 100/max_connections = 300/g' /etc/postgresql/9.4/main/postgresql.conf # Allow more than 100 connections to DB
        - sudo service postgresql restart

Hope this can help !