linux 域名解析服务基本使用

linux上的nscd域名缓存服务


基本命令:
nano /etc/nscd.conf   配置文件
/etc/init.d/nscd restart 启动
nscd -g  显示nscd的工作的统计信息


配置文件相关参数说明如下:
cachename 可以为hosts/groups/passwd
positive-time-to-live cachename value:是成功的查询在指定的cache中的缓存时间,这个值是以秒为单位。这个值应该调到尽量调小。
negative-time-to-live cachename value:是不成功的查询在指定的cache中的缓存时间,这个值是以秒为单位。这个值也应该调到尽量的小。
keep-hot-count cachename value:是在指定cache中当前的缓存的条目数。一般地,缓存内的条目数应接近24小时内经常访问到的条目数量。

check-files    hosts    yes  // 此项应该为对修改的文件进行检查,修改后就会马上反应出变化


如:

enable-cache            hosts           yes
positive-time-to-live hosts 21600 //6小时
negative-time-to-live hosts 20
keep-hot-count hosts 80 //经常请求站点数
check-files     hosts   yes 



------------------------ # nscd -g
nscd configuration:


              0  server debug level
         1m 47s  server runtime
             11  current number of threads
             32  maximum number of threads
              7  number of times clients had to wait
             no  paranoia mode enabled
           3600  restart internal


passwd cache:


            yes  cache is enabled
             no  cache is persistent
             no  cache is shared
            211  suggested size
         216064  total data pool size
            376  used data pool size
            600  seconds time to live for positive entries
             20  seconds time to live for negative entries
             55  cache hits on positive entries
              0  cache hits on negative entries
              2  cache misses on positive entries
              0  cache misses on negative entries
             96% cache hit rate
              4  current number of cached values
              4  maximum number of cached values
              1  maximum chain length searched
              0  number of delays on rdlock
              0  number of delays on wrlock
              0  memory allocations failed
            yes  check /etc/passwd for changes


group cache:


            yes  cache is enabled
             no  cache is persistent
             no  cache is shared
            211  suggested size
         216064  total data pool size
            216  used data pool size
           3600  seconds time to live for positive entries
             60  seconds time to live for negative entries
              7  cache hits on positive entries
              0  cache hits on negative entries
              2  cache misses on positive entries
              0  cache misses on negative entries
             77% cache hit rate
              3  current number of cached values
              3  maximum number of cached values
              1  maximum chain length searched
              0  number of delays on rdlock
              0  number of delays on wrlock
              0  memory allocations failed
            yes  check /etc/group for changes


hosts cache:


            yes  cache is enabled
             no  cache is persistent
             no  cache is shared
           8000  suggested size
        8192000  total data pool size
          39368  used data pool size
          21600  seconds time to live for positive entries
             20  seconds time to live for negative entries
             19  cache hits on positive entries
              0  cache hits on negative entries
            317  cache misses on positive entries
              0  cache misses on negative entries
              5% cache hit rate
            306  current number of cached values
            312  maximum number of cached values
              1  maximum chain length searched
              0  number of delays on rdlock
              0  number of delays on wrlock
              0  memory allocations failed
            yes  check /etc/hosts for changes


services cache:


             no  cache is enabled
             no  cache is persistent
             no  cache is shared
              0  suggested size
              0  total data pool size
              0  used data pool size
          28800  seconds time to live for positive entries
             20  seconds time to live for negative entries
              0  cache hits on positive entries
              0  cache hits on negative entries
              0  cache misses on positive entries
              0  cache misses on negative entries
              0% cache hit rate
              0  current number of cached values
              0  maximum number of cached values
              0  maximum chain length searched
              0  number of delays on rdlock
              0  number of delays on wrlock
              0  memory allocations failed
            yes  check /etc/services for changes

你可能感兴趣的:(linux,工作,cache,server,360)