Shared memory for Ldap 5.x
This is for ZCS 5.0.x only, and will not survive upgrades. Our recommendation is to upgrade to ZCS 6.0.x and above and use the LC key to use SHM keys. However if upgrading is not an option at this point and the need to use SHM keys is urgent then follow the below step.
Pre requisites : Setup kernel paramaters to use the defined space from memory for shared keys
To setup SHM keys :
1. Calculate and set kernel.shmall and kernel.shmmax
2. ldap stop
3. Remove existing cache files
/opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/ This is being done to clear current MMAP files, so that if and when you roll back you have a clean slate.
3.5 Confirm whether "/opt/zimbra/openldap-data" and __db.* is deleted.
4. Set the shared memory keys in /opt/zimbra/conf/slapd.conf.in
#shmkey shm_key 5.
5. Start ldap.
6. Verify if memory keys are being used:
ipcs -mp (the column CPID is the process ID which is using the shared memory referenced by the key which was set up in step 6)
To Roll back to MMAP :
1. ldap stop.
2. Remove the cache files
/opt/zimbra/sleepycat/bin/db_recover -c -h /opt/zimbra/openldap-data/ (this should delete the bdb cache files)
3. ipcrm [ -M key or -m id ] (to delete files from memory, at this point rebooting should also clear the memory files)******
Skip this if the file has already been removed, but please confirm using ipcs -m or ipcs -mp to check if the memory keys have been removed. If not then user ipcrm to manually delete the shm keys.
4. update config to comment/remove shm keys configuration.
5. start ldap (this should now be using the MMAP files).