7.2. 调整数据库索引缓存大小

重要

红帽建议您使用内置缓存自动缩放功能来优化性能。只有在需要与自动调整的值分离时才会更改这个值。

nsslapd-dbcachesize 属性控制数据库索引使用的内存量。这个缓存大小对 Directory 服务器性能的影响比条目缓存大小的影响要小。但是如果在设定了条目缓存大小后有可用的 RAM,红帽建议增加分配给数据库缓存的内存量。

数据库缓存限制为 1.5 GB RAM,因为更高的值并不会提高性能。

默认值

10000000 (10 MB)

有效范围

500000 - 1610611911 (500 kB - 1.5GB)

条目 DN 位置

cn=config,cn=ldbm database,cn=plugins,cn=config

先决条件

  • LDAP Directory Manager 密码

流程

  1. 禁用自动缓存调整,并设置数据库缓存大小。这个示例将数据库缓存设置为 256MB。

    [root@server ~]# dsconf -D "cn=Directory Manager" ldap://server.example.com backend config set --cache-autosize=0 --dbcachesize=268435456
  2. 重启 Directory 服务器。

    [root@server ~]# systemctl restart dirsrv.target
  3. 监控 IdM 目录服务器的性能。如果它没有以理想的方式改变,请重复这个过程并将 dbcachesize 调整为不同的值,或者重新启用缓存自动大小。

验证步骤

  • 显示 nsslapd-dbcachesize 属性的值,并将其设置为您所需的值。

    [root@server ~]# ldapsearch -D "cn=directory manager" -w DirectoryManagerPassword -b "cn=config,cn=ldbm database,cn=plugins,cn=config" | grep nsslapd-dbcachesize
    nsslapd-dbcachesize: 2147483648

其他资源