varnish 4.0 官方文档翻译11-Parameters

Parameters

Varnish cache 拥有一个参数的集合,可以影响varnish的行为和性能。基本上所有的参数都可以在Varnish命令行接口(varnishadm)使用param.set关键词来设置。

一些参数,处于安全的目的只读的参数,只能使用-r参数来开启。同时在varnishd的man手册中也有相关的说明

-r param[,param...]
  Make  the listed parameters read only. 
  This gives the system administrator a way to limit what the Varnish CLI can do.  
  Consider making parameters such as user, group, cc_command, vcc_allow_inline_c 
  read only as these can potentially  be used  to  escalate
  privileges from the CLI.  Protecting listen_address may also be a good idea.

我们不建议你调整参数除非你确定你做的是什么。我们努力的使用稳定的默认值,同时varnish使用默认设置应当能处理大多数的工作情况。

完整的参数列表可以通过在命令行使用param.show来查看。

varnish> param.show
200        
acceptor_sleep_decay       0.9 (default)
acceptor_sleep_incr        0.001 [seconds] (default)
acceptor_sleep_max         0.050 [seconds] (default)
auto_restart               on [bool] (default)
ban_dups                   on [bool] (default)
ban_lurker_age             60.000 [seconds] (default)
ban_lurker_batch           1000 (default)
ban_lurker_sleep           0.010 [seconds] (default)
between_bytes_timeout      60.000 [seconds] (default)
busyobj_worker_cache       off [bool] (default)
cc_command                 "exec gcc -std=gnu99  -O2 -g -Wp,-D_FORTIFY_SOURCE=0 -Wall -Werror -pthread -fpic -shared -Wl,-x -o %o %s" (default)
cli_buffer                 8k [bytes] (default)
cli_limit                  48k [bytes] (default)
cli_timeout                60.000 [seconds] (default)
clock_skew                 10 [seconds] (default)
connect_timeout            3.500 [seconds] (default)
critbit_cooloff            180.000 [seconds] (default)
debug                      none (default)
default_grace              10.000 [seconds] (default)
default_keep               0.000 [seconds] (default)
default_ttl                120.000 [seconds] (default)
feature                    none (default)
fetch_chunksize            16k [bytes] (default)
fetch_maxchunksize         0.25G [bytes] (default)
first_byte_timeout         60.000 [seconds] (default)
group                      GID 0 (default)
group_cc                   <not set> (default)
gzip_buffer                32k [bytes] (default)
gzip_level                 6 (default)
gzip_memlevel              8 (default)
http_gzip_support          on [bool] (default)
http_max_hdr               64 [header lines] (default)
http_range_support         on [bool] (default)
http_req_hdr_len           8k [bytes] (default)
http_req_size              32k [bytes] (default)
http_resp_hdr_len          8k [bytes] (default)
http_resp_size             32k [bytes] (default)
idle_send_timeout          60.000 [seconds] (default)
listen_address             :80 (default)
listen_depth               1024 [connections] (default)
lru_interval               2.000 [seconds] (default)
max_esi_depth              5 [levels] (default)
max_restarts               4 [restarts] (default)
max_retries                4 [retries] (default)
nuke_limit                 50 [allocations] (default)
pcre_match_limit           10000 (default)
pcre_match_limit_recursion 10000 (default)
ping_interval              3 [seconds] (default)
pipe_timeout               60.000 [seconds] (default)
pool_req                   10,100,10 (default)
pool_sess                  10,100,10 (default)
pool_vbc                   10,100,10 (default)
pool_vbo                   10,100,10 (default)
prefer_ipv6                off [bool] (default)
rush_exponent              3 [requests per request] (default)
send_timeout               600.000 [seconds] (default)
session_max                100000 [sessions] (default)
shm_reclen                 255b [bytes] (default)
shortlived                 10.000 [seconds] (default)
sigsegv_handler            off [bool] (default)
syslog_cli_traffic         on [bool] (default)
tcp_keepalive_intvl        75.000 [seconds] (default)
tcp_keepalive_probes       9 [probes] (default)
tcp_keepalive_time         7200.000 [seconds] (default)
thread_pool_add_delay      0.000 [seconds] (default)
thread_pool_destroy_delay  1.000 [seconds] (default)
thread_pool_fail_delay     0.200 [seconds] (default)
thread_pool_max            1000 [threads]
thread_pool_min            50 [threads]
thread_pool_stack          48k [bytes] (default)
thread_pool_timeout        120.000 [seconds]
thread_pools               2 [pools] (default)
thread_queue_limit         20 (default)
thread_stats_rate          10 [requests] (default)
timeout_idle               5.000 [seconds] (default)
timeout_linger             0.050 [seconds] (default)
timeout_req                2.000 [seconds] (default)
user                       nobody (99) (default)
vcc_allow_inline_c         off [bool] (default)
vcc_err_unref              on [bool] (default)
vcc_unsafe_path            on [bool] (default)
vcl_dir                    /etc/varnish (default)
vmod_dir                   /usr/lib64/varnish/vmods (default)
vsl_buffer                 4k [bytes] (default)
vsl_mask                   -VCL_trace,-WorkThread,-Hash (default)
vsl_reclen                 255b [bytes] (default)
vsl_space                  80M [bytes] (default)
vsm_space                  1M [bytes] (default)
waiter                     epoll (possible values: epoll, poll) (default)
workspace_backend          64k [bytes] (default)
workspace_client           64k [bytes] (default)
workspace_session          384b [bytes] (default)
workspace_thread           2k [bytes] (default)

为了检查某一的参数和获取参数的用法、描述、默认值,通过键入param.show 和参数名,像这样:

varnish> param.show shortlived
200
shortlived                  10.000000 [s]
                            Default is 10.0
                            Objects created with TTL shorter than this are
                            always put in transient storage.
varnish> param.show thread_pools  
200        
thread_pools
        Value is: 2 [pools] (default)
        Default is: 2
        Minimum is: 1

        Number of worker thread pools.

        Increasing number of worker pools decreases lock contention.

        Too many pools waste CPU and RAM resources, and more than one
        pool for each CPU is probably detrimal to performance.

        Can be increased on the fly, but decreases require a restart to
        take effect.

        NB: This parameter may take quite some time to take (full)
        effect.

        NB: We do not know yet if it is a good idea to change this
        parameter, or if the default value is even sensible.  Caution
        is advised, and feedback is most welcome.


转载于:https://my.oschina.net/monkeyzhu/blog/466876

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值