Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

389ds DB size Looks Bigger #6334

Open
Hariprasath-3091 opened this issue Sep 22, 2024 · 4 comments
Open

389ds DB size Looks Bigger #6334

Hariprasath-3091 opened this issue Sep 22, 2024 · 4 comments
Labels
needs triage The issue will be triaged during scrum

Comments

@Hariprasath-3091
Copy link

Issue Description
We see the DB Size of 389ds looks very big than usual where we suspect some tuning is needed accordingly.

Package Version and Platform:

  • Platform: SUSE
  • Package and version: 389-ds-2.0.17~git7.959d36e-150400.3.20.1.x86_64
  • Browser chrome

Steps to Reproduce
Steps to reproduce the behavior:

  1. Install the 389ds with above version.
  2. Enable a DB with 3000 records.
  3. you will see the DB size with more than 1 GB

Expected results
Expecting the DB size to be less than 300MB

Screenshots
image

Additional context
We enabled below tuning already as below on the 389ds Instance
dsconf slapd-localhost replication set-changelog --suffix "${MYBASE}" --max-age "1d";
dsconf slapd-localhost backend index add --attr sudohost --index-type eq --reindex userroot;
dsconf slapd-localhost backend index add --attr ipserviceprotocol --index-type eq --reindex userroot;
dsconf slapd-localhost backend index add --attr ou --index-type eq --reindex userroot;
dsconf slapd-localhost backend index delete --attr uidNumber userroot;
dsconf slapd-localhost backend index add --attr uidNumber --index-type eq --reindex userroot;
dsconf slapd-localhost backend index delete --attr gidNumber userroot;
dsconf slapd-localhost backend index add --attr gidNumber --index-type eq --reindex userroot;
dsconf slapd-localhost backend index delete --attr memberuid userroot;
dsconf slapd-localhost backend index add --attr memberuid --index-type eq --reindex userroot;
dsconf slapd-localhost security set --tls-client-renegotiation=off;
dsconf slapd-localhost config replace nsslapd-idletimeout=60;
dsconf slapd-localhost config replace nsslapd-maxdescriptors=524288;
dsconf slapd-localhost config replace nsslapd-conntablesize=64000;
dsconf slapd-localhost config replace nsslapd-threadnumber=32;
dsconf slapd-localhost config replace nsslapd-listenhost=0.0.0.0;
dsconf slapd-localhost config replace nsslapd-securelistenhost=0.0.0.0;

@Hariprasath-3091 Hariprasath-3091 added the needs triage The issue will be triaged during scrum label Sep 22, 2024
@tbordaz
Copy link
Contributor

tbordaz commented Sep 23, 2024

Hi,
I agree that 1Gb looks too much for 3000 entries.
Could you provide the output of 'ls -l /var/lib/dirsrv/slapd-localhost/db /var/lib/dirsrv/slapd-localhost/db/*'

@progier389
Copy link
Contributor

IMHO, That is probably the db cache size that is too big because of the autotuning (autotuning database cache size is based on available system memory), I think that you need to disable the autotuning and configure a small database cache.

@Hariprasath-3091
Copy link
Author

@tbordaz

ls -l /var/lib/dirsrv/slapd-localhost/db /var/lib/dirsrv/slapd-localhost/db/*

ldapmaster01-389ds:/ # ls -l /var/lib/dirsrv/slapd-localhost/db /var/lib/dirsrv/slapd-localhost/db/*
-rw------- 1 dirsrv dirsrv         51 Sep 18 09:09 /var/lib/dirsrv/slapd-localhost/db/DBVERSION
-rw------- 1 dirsrv dirsrv      24576 Sep 18 09:09 /var/lib/dirsrv/slapd-localhost/db/__db.001
-rw------- 1 dirsrv dirsrv   54091776 Sep 23 15:04 /var/lib/dirsrv/slapd-localhost/db/__db.002
-rw------- 1 dirsrv dirsrv 1048567808 Sep 23 15:03 /var/lib/dirsrv/slapd-localhost/db/__db.003
-rw------- 1 dirsrv dirsrv    1081344 Sep 23 15:03 /var/lib/dirsrv/slapd-localhost/db/__db.004
-rw------- 1 dirsrv dirsrv    8863744 Sep 23 15:03 /var/lib/dirsrv/slapd-localhost/db/__db.005
-rw------- 1 dirsrv dirsrv      90112 Sep 23 15:03 /var/lib/dirsrv/slapd-localhost/db/__db.006
-rw------- 1 dirsrv dirsrv   10485760 Sep 23 15:04 /var/lib/dirsrv/slapd-localhost/db/log.0000000026

/var/lib/dirsrv/slapd-localhost/db:
total 1093232
-rw------- 1 dirsrv dirsrv         51 Sep 18 09:09 DBVERSION
-rw------- 1 dirsrv dirsrv      24576 Sep 18 09:09 __db.001
-rw------- 1 dirsrv dirsrv   54091776 Sep 23 15:04 __db.002
-rw------- 1 dirsrv dirsrv 1048567808 Sep 23 15:03 __db.003
-rw------- 1 dirsrv dirsrv    1081344 Sep 23 15:03 __db.004
-rw------- 1 dirsrv dirsrv    8863744 Sep 23 15:03 __db.005
-rw------- 1 dirsrv dirsrv      90112 Sep 23 15:03 __db.006
-rw------- 1 dirsrv dirsrv   10485760 Sep 23 15:04 log.0000000026
drwx------ 2 dirsrv dirsrv       4096 Sep 15 04:52 userroot

/var/lib/dirsrv/slapd-localhost/db/userroot:
total 30740
-rw------- 1 dirsrv dirsrv       51 Sep 18 09:09 DBVERSION
-rw------- 1 dirsrv dirsrv    16384 Sep 15 01:45 aci.db4
-rw------- 1 dirsrv dirsrv   638976 Sep 23 10:37 ancestorid.db4
-rw------- 1 dirsrv dirsrv  1392640 Sep 23 10:37 cn.db4
-rw------- 1 dirsrv dirsrv  2424832 Sep 23 10:37 entryrdn.db4
-rw------- 1 dirsrv dirsrv    90112 Sep 23 10:37 gidNumber.db4
-rw------- 1 dirsrv dirsrv   262144 Sep 23 03:10 givenName.db4
-rw------- 1 dirsrv dirsrv 18243584 Sep 23 15:03 id2entry.db4
-rw------- 1 dirsrv dirsrv    40960 Sep 23 10:37 ipserviceprotocol.db4
-rw------- 1 dirsrv dirsrv   638976 Sep 23 03:10 mail.db4
-rw------- 1 dirsrv dirsrv   614400 Sep 23 14:09 memberuid.db4
-rw------- 1 dirsrv dirsrv    16384 Sep 23 09:10 nsTombstoneCSN.db4
-rw------- 1 dirsrv dirsrv    16384 Sep 23 09:10 nscpEntryDN.db4
-rw------- 1 dirsrv dirsrv    16384 Sep 15 04:52 nsds5ReplConflict.db4
-rw------- 1 dirsrv dirsrv   933888 Sep 23 10:37 nsuniqueid.db4
-rw------- 1 dirsrv dirsrv    16384 Sep 23 10:37 numsubordinates.db4
-rw------- 1 dirsrv dirsrv   548864 Sep 23 10:37 objectclass.db4
-rw------- 1 dirsrv dirsrv   122880 Sep 23 10:37 ou.db4
-rw------- 1 dirsrv dirsrv   352256 Sep 23 10:37 parentid.db4
-rw------- 1 dirsrv dirsrv  3612672 Sep 23 14:16 replication_changelog.db4
-rw------- 1 dirsrv dirsrv   851968 Sep 23 10:37 sn.db4
-rw------- 1 dirsrv dirsrv    16384 Sep 15 00:11 sudohost.db4
-rw------- 1 dirsrv dirsrv   253952 Sep 22 17:11 telephoneNumber.db4
-rw------- 1 dirsrv dirsrv   180224 Sep 23 10:37 uid.db4
-rw------- 1 dirsrv dirsrv   163840 Sep 23 10:37 uidNumber.db4
ldapmaster01-389ds:/ #

@tbordaz
Copy link
Contributor

tbordaz commented Sep 24, 2024

Like @progier389 said the culprit was the dbcache (__db.003 that is 1Gb by itself). This size is defined by autotuning. You may disable it and tune the attribute 'nsslapd-dbcachesize' (cn=bdb,cn=config,cn=ldbm database,cn=plugins,cn=config).
The dbcache does not need to located on disk. In recent versions, for performance benefit, it is located on tmpfs 'nsslapd-db-home-directory=/dev/shm/slapd-instance'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage The issue will be triaged during scrum
Projects
None yet
Development

No branches or pull requests

3 participants