Hi
I am running on a vm dovecot and sendmail with authentication through pam agains ldap. I have got strange spikes in the load and I think slapd is writing to much to disk. I want to reduce disk io.
Anybody an idea why slapd is so often writing to disk instead of reading?
The slapd process keeps writing to disk although it is setup as a 'consumer' and it does not receive any new data. There are only 2200 records and olcDbDNcacheSize and olcDbIDLcacheSize are both set to 3000.
Thanks in advance for suggestions.
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 10297 be/4 ldap 0.00 B/s 42.66 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 10298 be/4 ldap 0.00 B/s 11.64 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 10299 be/4 ldap 0.00 B/s 11.64 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] 3 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 4 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0] 5 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0] 7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1] 8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
Are you using memory mapped files for BdB ? You should move to shared mem.
++Cyrille
-----Original Message----- From: openldap-technical-bounces@OpenLDAP.org [mailto:openldap-technical-bounces@OpenLDAP.org] On Behalf Of Marc Roos Sent: Monday, March 05, 2012 11:51 PM To: openldap-technical@openldap.org Subject: Help tweaking settings so slapd is not writing to disk so much
Hi
I am running on a vm dovecot and sendmail with authentication through pam agains ldap. I have got strange spikes in the load and I think slapd is writing to much to disk. I want to reduce disk io.
Anybody an idea why slapd is so often writing to disk instead of reading?
The slapd process keeps writing to disk although it is setup as a 'consumer' and it does not receive any new data. There are only 2200 records and olcDbDNcacheSize and olcDbIDLcacheSize are both set to 3000.
Thanks in advance for suggestions.
Total DISK READ: 0.00 B/s | Total DISK WRITE: 0.00 B/s TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 10297 be/4 ldap 0.00 B/s 42.66 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 10298 be/4 ldap 0.00 B/s 11.64 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 10299 be/4 ldap 0.00 B/s 11.64 K/s 0.00 % 0.00 % slapd -h ldap:///~/ ldapi:/// -u ldap 1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init 2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd] 3 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 4 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0] 5 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0] 6 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0] 7 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1] 8 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/1]
To enable shared memmory I just do this?
In DB_CONFIG: set_shm_key 1 And Put the slapd conf: olcDbShmKey to 1
And rebuild the bdb database in /var/lib/ldap/
I have a default (centos6) DB_CONFIG setup. ========================================== set_cachesize 0 268435456 1 set_lg_regionmax 262144 set_lg_bsize 2097152
db_stat -m -h /var/lib/ldap/ ============================ 320MB 2KB 24B Total cache size 1 Number of caches 1 Maximum number of caches 320MB 8KB Pool individual cache size 0 Maximum memory-mapped file size 0 Maximum open file descriptors 0 Maximum sequential buffer writes 0 Sleep after writing maximum sequential buffers 0 Requested pages mapped into the process' address space 16M Requested pages found in the cache (99%) 46 Requested pages not found in the cache 704 Pages created in the cache 46 Pages read into the cache 1271 Pages written from the cache to the backing file 0 Clean pages forced from the cache 0 Dirty pages forced from the cache 0 Dirty pages written by trickle-sync thread 750 Current total page count 557 Current clean page count 193 Current dirty page count 32771 Number of hash buckets used for page location 16M Total number of times hash chains searched for a page (16253171) 2 The longest hash chain searched for a page 16M Total number of hash chain entries checked for page (16304063) 1694 The number of hash bucket locks that required waiting (0%) 793 The maximum number of times any hash bucket lock was waited for (0%) 0 The number of region locks that required waiting (0%) 0 The number of buffers frozen 0 The number of buffers thawed 0 The number of frozen buffers freed 865 The number of page allocations 0 The number of hash buckets examined during allocations 0 The maximum number of hash buckets examined for an allocation 0 The number of pages examined during allocations 0 The max number of pages examined for an allocation 0 Threads waited on page I/O
Pool File: sendmailMTAAliasValue.bdb 4096 Page size 0 Requested pages mapped into the process' address space 1498 Requested pages found in the cache (99%) 2 Requested pages not found in the cache 0 Pages created in the cache 2 Pages read into the cache 1 Pages written from the cache to the backing file Pool File: uidNumber.bdb 4096 Page size 0 Requested pages mapped into the process' address space 44065 Requested pages found in the cache (99%) 2 Requested pages not found in the cache 10 Pages created in the cache 2 Pages read into the cache 22 Pages written from the cache to the backing file
Hello Marc,
You do not have to rebuild the bdb database AFAIK.
++Cyrille
-----Original Message----- From: Marc [mailto:M.Roos@roosit.eu] Sent: Tuesday, March 06, 2012 9:56 AM To: Maucci, Cyrille; openldap-technical@openldap.org Subject: RE: Help tweaking settings so slapd is not writing to disk so much
To enable shared memmory I just do this?
In DB_CONFIG: set_shm_key 1 And Put the slapd conf: olcDbShmKey to 1
And rebuild the bdb database in /var/lib/ldap/
I have a default (centos6) DB_CONFIG setup. ========================================== set_cachesize 0 268435456 1 set_lg_regionmax 262144 set_lg_bsize 2097152
db_stat -m -h /var/lib/ldap/ ============================ 320MB 2KB 24B Total cache size 1 Number of caches 1 Maximum number of caches 320MB 8KB Pool individual cache size 0 Maximum memory-mapped file size 0 Maximum open file descriptors 0 Maximum sequential buffer writes 0 Sleep after writing maximum sequential buffers 0 Requested pages mapped into the process' address space 16M Requested pages found in the cache (99%) 46 Requested pages not found in the cache 704 Pages created in the cache 46 Pages read into the cache 1271 Pages written from the cache to the backing file 0 Clean pages forced from the cache 0 Dirty pages forced from the cache 0 Dirty pages written by trickle-sync thread 750 Current total page count 557 Current clean page count 193 Current dirty page count 32771 Number of hash buckets used for page location 16M Total number of times hash chains searched for a page (16253171) 2 The longest hash chain searched for a page 16M Total number of hash chain entries checked for page (16304063) 1694 The number of hash bucket locks that required waiting (0%) 793 The maximum number of times any hash bucket lock was waited for (0%) 0 The number of region locks that required waiting (0%) 0 The number of buffers frozen 0 The number of buffers thawed 0 The number of frozen buffers freed 865 The number of page allocations 0 The number of hash buckets examined during allocations 0 The maximum number of hash buckets examined for an allocation 0 The number of pages examined during allocations 0 The max number of pages examined for an allocation 0 Threads waited on page I/O
Pool File: sendmailMTAAliasValue.bdb 4096 Page size 0 Requested pages mapped into the process' address space 1498 Requested pages found in the cache (99%) 2 Requested pages not found in the cache 0 Pages created in the cache 2 Pages read into the cache 1 Pages written from the cache to the backing file Pool File: uidNumber.bdb 4096 Page size 0 Requested pages mapped into the process' address space 44065 Requested pages found in the cache (99%) 2 Requested pages not found in the cache 10 Pages created in the cache 2 Pages read into the cache 22 Pages written from the cache to the backing file
Marc wrote:
To enable shared memmory I just do this?
In DB_CONFIG: set_shm_key 1
No.
And Put the slapd conf: olcDbShmKey to 1
No. Read the slapd-bdb(5) manpage.
And rebuild the bdb database in /var/lib/ldap/
You don't need to rebuild the database. Just run db_recover on the database.
I have a default (centos6) DB_CONFIG setup.
set_cachesize 0 268435456 1 set_lg_regionmax 262144 set_lg_bsize 2097152
I think if you had mounted the DB's filesystem with noatime or relatime that would also have removed the problem.
The filesystem is already mounted with no atime.(but it is a vmware guest, with ide drive this still needs to be fixed)
I read the slapd-bdb man page and I get now that slapd's conf is complementing the DB_CONFIG file. But with setting this olcDbShmKey to 1 (removed it from DB_CONFIG). I am not seeing the slapd process constantly in iotop -o. Why is it not good to set this?
I also enabled dovecot auth caching and nscd
--On Wednesday, March 07, 2012 12:36 AM +0100 Marc M.Roos@roosit.eu wrote:
The filesystem is already mounted with no atime.(but it is a vmware guest, with ide drive this still needs to be fixed)
I read the slapd-bdb man page and I get now that slapd's conf is complementing the DB_CONFIG file. But with setting this olcDbShmKey to 1 (removed it from DB_CONFIG). I am not seeing the slapd process constantly in iotop -o. Why is it not good to set this?
olcDbShmKey applies to a cn=config configured slapd. You use "shmkey" for a slapd.conf configured slapd. Read the man page carefully.
--Quanah
--
Quanah Gibson-Mount Sr. Member of Technical Staff Zimbra, Inc A Division of VMware, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
openldap-technical@openldap.org