我有一个运行Apache2的Ubnutu 12.04服务器,configuration为反向代理。 Apache已进一步configuration为通过LDAP进行基本身份validation。 一切工作正常,除了performance有点滞后。 LDAPauthentication指令是:
<Location /> AuthType Basic AuthBasicProvider ldap AuthName "Secure Intranet" AuthLDAPURL ldaps://virt-ldap.mylan.int:636/ou=MyCorp,dc=mylan,dc=int AuthzLDAPAuthoritative on AuthLDAPGroupAttribute memberUid AuthLDAPGroupAttributeIsDN off Require ldap-group cn=development,ou=groups,ou=MyCorp,dc=mylan,dc=int </Location>
经过检查,我注意到,Apache的每一个请求都会返回到我的OpenLDAP服务器,为特定用户运行search/绑定。 根据代理后面站点的HTML,一些请求(例如JIRA)可能导致通过LAN的10或15个search/绑定LDAP调用。 我知道这一点,因为我在浏览时拖拽OpenLDAP日志。 哎呀!
根据Apache2的ldap文档 ,默认情况下,mod_ldap应该caching这些东西。 考虑到文档可能是错误的,我在ldap.conf中添加了这些指令:
LDAPSharedCacheSize 500000 LDAPCacheEntries 1024 LDAPCacheTTL 600 LDAPOpCacheEntries 1024 LDAPOpCacheTTL 600
但是没有什么区别。
编辑:
在服务器上使用lynx访问https://localhost/ldap-status返回了以下内容:
LDAP Cache Information Cache Name Entries Avg. Chain Len. Hits Ins/Rem Purges Avg Purge Time LDAP URL Cache 1 (0% ull) 1.0 282/283 100% 1/0 (none) 0ms ldaps://virt-ldap.mylan.int:636/ou=MyCorp,dc=mylan,dc=int (Searches) 3 (0% full) 1.0 138/154 90% 6/3 (none) 0ms ldaps://virt-ldap.mylan.int:636/ou=MyCorp,dc=mylan,dc=int (Compares) 3 (0% full) 1.0 138/148 93% 6/3 (none) 0ms ldaps://virt-ldap.mylan.int:636/ou=MyCorp,dc=mylan,dc=int (DNCompares) 0 (0% full) 0.0 0/0 100% 0/0 (none) 0ms
所以看起来像caching工作,但我不知道这些数字是什么意思。 我仍然在LDAP服务器上获得大量的LAN命中。
有两件事情浮现在脑海里: