控制本地名字服务的缓存时间

  • /usr/sbin/nscd - name service cache daemon

以及nscd.conf

一个例子

#
# /etc/nscd.conf
#
# An example Name Service Cache config file. This file is needed by nscd.
#
# Legal entries are:
#
#logfile<file>
#debug-level<level>
#threads<initial #threads to use>
#max-threads<maximum #threads to use>
#server-user <user to run server as instead of root>
#server-user is ignored if nscd is started with -S parameters
# stat-user <user who is allowed to request statistics>
#reload-countunlimited|<number>
#paranoia<yes|no>
#restart-interval<time in seconds>
#
# enable-cache<service> <yes|no>
#positive-time-to-live<service> <time in seconds>
#negative-time-to-live <service> <time in seconds>
# suggested-size<service> <prime number>
#check-files<service> <yes|no>
#persistent<service> <yes|no>
#shared<service> <yes|no>
#
# Currently supported cache names (services): passwd, group, hosts
#


#logfile/var/log/nscd.log
#threads6
#max-threads128
#server-usernobody
#stat-usersomebody
debug-level0
#reload-count5
paranoiano
#restart-interval3600

enable-cachepasswdyes
positive-time-to-livepasswd600
negative-time-to-livepasswd20
suggested-sizepasswd211
check-filespasswdyes
persistentpasswdyes
sharedpasswdyes

enable-cachegroupyes
positive-time-to-livegroup3600
negative-time-to-livegroup60
suggested-sizegroup211
check-filesgroupyes
persistentgroupyes
sharedgroupyes

#enable-cachehostsyes
enable-cachehostsno
positive-time-to-livehosts3600
negative-time-to-livehosts20
suggested-sizehosts211
check-fileshostsyes
persistenthostsyes
sharedhostsyes
========================================================================

NSCD.CONF
5
1999-10
GNU C Library
  • NAME
    • /etc/nscd.conf - name service cache daemon configuration file
  • DESCRIPTION
    • The file
    /etc/nscd.conf is read from nscd(8) at startup. Each line specifies either an attribute and a value, or an attribute, service, and a value. Fields are separated either by SPACE or TAB characters. A `#' (number sign) indicates the beginning of a comment; following characters, up to the end of the line, are not interpreted by nscd.

    Valid services are passwd, group, or hosts.
    logfile debug-file-name
    <!-- -->Specifies name of the file to which debug info should be written.
    <!-- -->
    debug-level value
    <!-- -->Sets the desired debug level.
    <!-- -->
    threads number
    <!-- -->This is the number of threads that are started to wait for requests. At least five threads will always be created.
    <!-- -->
    server-user user
    <!-- -->If this option is set, nscd will run as this user and not as root. If a separate cache for every user is used (-S parameter), this option is ignored.
    <!-- -->
    enable-cache service <yes|no>
    <!-- -->Enables or disables the specified service cache.
    <!-- -->
    positive-time-to-live service value
    <!-- -->Sets the TTL (time-to-live) for positive entries (successful queries) in the specified cache for service . Value is in seconds. Larger values increase cache hit rates and reduce mean response times, but increase problems with cache coherence.
    <!-- -->
    negative-time-to-live service value
    <!-- -->Sets the TTL (time-to-live) for negative entries (unsuccessful queries) in the specified cache for service . Value is in seconds. Can result in significant performance improvements if there are several files owned by uids (user IDs) not in system databases (for example untarring the linux kernel sources as root); should be kept small to reduce cache coherency problems.
    <!-- -->
    suggested-size service value
    <!-- -->This is the internal hash table size, value should remain a prime number for optimum efficiency.
    <!-- -->
    check-files service <yes|no>
    <!-- -->Enables or disables checking the file belonging to the specified service for changes. The files are /etc/passwd , /etc/group , and /etc/hosts .
    <!-- -->
SEE ALSO
nscd(8) AUTHOR
nscd was written by Thorsten Kukuk and Ulrich Drepper.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值