Last active
August 29, 2015 13:56
-
-
Save satoruk/8971789 to your computer and use it in GitHub Desktop.
Varnish Cache 運用編 ref: http://qiita.com/satoruk/items/37fc2824c932fc4ad94a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct backend { | |
unsigned magic; | |
#define BACKEND_MAGIC 0x64c4c7c6 | |
VTAILQ_ENTRY(backend) list; | |
int refcount; | |
struct lock mtx; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int __match_proto__() | |
do_list(struct cli *cli, struct backend *b, void *priv) | |
{ | |
/* 省略 */ | |
VCLI_Out(cli, "\n%-30s %-6d", b->display_name, b->refcount); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 "ban.url .*" | |
# echo $? | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# varnishadm backend.list | |
Backend name Refs Admin Probe | |
web_01(192.168.0.11,,8080) 1 probe Healthy 3/3 | |
web_02(192.168.0.12,,8080) 1 probe Healthy 3/3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# varnishadm backend.set_health web_01 sick | |
# varnishadm backend.list | |
Backend name Refs Admin Probe | |
web_01(192.168.0.11,,8080) 1 sick Healthy 3/3 | |
web_02(192.168.0.12,,8080) 1 probe Healthy 3/3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 BackendClose - default | |
14 BackendOpen b default 192.168.0.110 37567 192.168.0.111 8080 | |
14 TxRequest b HEAD | |
14 TxURL b /robots.txt | |
14 TxProtocol b HTTP/1.1 | |
14 TxHeader b Authorization: Basic aG9iZWhvZ2U6aG9nZWhvZ2U= | |
14 TxHeader b User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 | |
14 TxHeader b Host: hogehoge.jp | |
14 TxHeader b Accept: */* | |
14 TxHeader b X-Forwarded-For: 192.168.0.101 | |
14 TxHeader b X-Varnish: 301929229 | |
14 RxProtocol b HTTP/1.1 | |
14 RxStatus b 404 | |
14 RxResponse b Not Found | |
14 RxHeader b Server: Apache-Coyote/1.1 | |
14 RxHeader b Content-Length: 0 | |
14 RxHeader b Date: Thu, 30 Jan 2014 10:12:26 GMT | |
14 Fetch_Body b 0(none) cls 0 mklen 0 | |
14 Length b 0 | |
14 BackendReuse b default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 BackendClose - default | |
14 BackendOpen b default 192.168.0.110 37567 192.168.0.111 8080 | |
14 TxRequest b HEAD | |
14 TxURL b /robots.txt | |
14 TxProtocol b HTTP/1.1 | |
14 TxHeader b Authorization: Basic aG9iZWhvZ2U6aG9nZWhvZ2U= | |
14 TxHeader b User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 | |
14 TxHeader b Host: hogehoge.jp | |
14 TxHeader b Accept: */* | |
14 TxHeader b X-Forwarded-For: 192.168.0.101 | |
14 TxHeader b X-Varnish: 301929229 | |
14 RxProtocol b HTTP/1.1 | |
14 RxStatus b 404 | |
14 RxResponse b Not Found | |
14 RxHeader b Server: Apache-Coyote/1.1 | |
14 RxHeader b Content-Length: 0 | |
14 RxHeader b Date: Thu, 30 Jan 2014 10:12:26 GMT | |
14 Fetch_Body b 0(none) cls 0 mklen 0 | |
14 Length b 0 | |
14 BackendReuse b default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment