我目前正在尝试在AWS上部署Varnish。 此清漆旨在缓存来自S3的1个文件(只有一个文件,小于10kb),命中率为10k + requests / s
我已经在m4.large实例(2vCPU / 8Gb Ram)上部署了我的服务器。 我已经从Jmeter集群启动了性能测试,但我无法传递3.5k req / s,而且它看起来有点低。
当我检查我的系统指标时,我找不到任何瓶颈(CPU / Ram / IOPS / Network)。
我的清漆命令行:
/usr/sbin/varnishd -a :6081 -f /etc/varnish/default.vcl -T 127.0.0.1:6082 -t 86400 -u varnish -g varnish -S /etc/varnish/secret -s malloc,1G -p idle_send_timeout=0 -p thread_pool_min=500 -p timeout_linger=100000 -p thread_pool_add_delay=2 -P /var/run/varnish.pid
操作系统:AWS AMI - 2017.09.1
清漆版本:varnishd(清漆-4.0.5修订版07eff4c29)
这是我的param.show
-----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,4.9.62-21.56.amzn1.x86_64,x86_64,-smalloc,-smalloc,-hcritbit
varnish-4.0.5 revision 07eff4c29
Type 'help' for command list.
Type 'quit' to close CLI session.
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 86400.000 [seconds]
feature none (default)
fetch_chunksize 16k [bytes] (default)
fetch_maxchunksize 0.25G [bytes] (default)
first_byte_timeout 60.000 [seconds] (default)
group varnish (497)
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 0.000 [seconds]
listen_address :6081
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 2.000 [seconds]
thread_pool_destroy_delay 1.000 [seconds] (default)
thread_pool_fail_delay 0.200 [seconds] (default)
thread_pool_max 5000 [threads] (default)
thread_pool_min 500 [threads]
thread_pool_stack 48k [bytes] (default)
thread_pool_timeout 300.000 [seconds] (default)
thread_pools 2 [pools] (default)
thread_queue_limit 20 (default)
thread_stats_rate 10 [requests] (default)
timeout_idle 5.000 [seconds] (default)
timeout_linger 100000.000 [seconds]
timeout_req 2.000 [seconds] (default)
user varnish (498)
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)
我的VCL文件:
vcl 4.0;
backend default
{
.host = "******.s3-website-eu-west-1.amazonaws.com";
.port = "80";
}
sub vcl_recv {
set req.http.Host = "******.s3-website-eu-west-1.amazonaws.com";
set req.http.Date = now;
unset req.http.Cookie;
}
sub vcl_backend_response {
set beresp.do_gzip = true;
}
sub vcl_deliver {
unset resp.http.set-cookie;
}
您是否知道我如何调整清漆以获得更好的吞吐量?
感谢您的回复。