Symptoms
In some instances, if your server has a large number of processes that are using the cPanel Calendar and Contacts Server this, might not work correctly.
Description
The issue will occur if the maximum connection limit is not enough to handle the service's number of processes.
To identify the issue you'll need to run the following:
[ root@server ~]# grep "too many clients" /opt/cpanel-ccs/data/Logs/error.log
2020-09-04T17:47:20+0100 [caldav-47] pg8000.core.ProgrammingError: (u'FATAL', u'53300', u'sorry, too many clients already', u'proc.c', u'336', u'InitProcess', u'', u'')
Workaround
When the above errors are present in the cPanel Calendar and Contacts Server log, you'll need to increase the maximum connection limit.
The following steps show how to accomplish this:
- Identify how many processes are trying to connect to the service.
[ root@server ~]# pgrep -c -u cpanel-ccs
- Identify the max_connections limit set within the CCS configuration file.
[ root@server ~]# grep max_connections /opt/cpanel-ccs/conf/caldavd-dev.plist
<string>-c max_connections=64</string>
- Increase the value accordingly by editing the CCS template file.
- The template will have a variable value that you can replace to accommodate your desired limit. To edit it, simply use a text editor to perform the changes.
-c max_connections=[% PGMAXCONNECTIONS %]
- Confirm the values you modified:
[ root@server ~]# grep max_connections /opt/cpanel-ccs/conf/caldavd.tmpl
<string>-c max_connections=128</string>
- Rebuild the CCS configuration
[ root@server ~]# /opt/cpanel-ccs/bin/rebuildccsconfig
- Verify that the changes done in the template file are reflected in the CCS configuration file.
[ root@server ~]# grep max_connections /opt/cpanel-ccs/conf/caldavd-dev.plist
<string>-c max_connections=128</string>
- Perform a restart of the CCS service to ensure the changes take place
/scripts/restartsrv_cpanel_ccs