PSQL

Hello everyone

I am having fusionpbx master version 5.0 with psql master master replication. Sometime i am getting this error on all pages
"error: SQLSTATE[08006] [7] FATAL: sorry, too many clients already FATAL: sorry, too many clients already"

Can anyone let me know what is the issue and how we can fix this.