ã¯ããã«
siege
ã使ã£ã¦ web ãµã¤ãã®ã¬ã¹ãã³ã¹ã¿ã¤ã ãç£è¦ããã- ã¤ãã§ã«
elasticsearch
ã¨kibana
ã§ã¬ã¹ãã³ã¹ã¿ã¤ã ãå¯è¦åãã¦ã¿ã - ããã¦ãããã®ãã¼ã«ã
docker
ã³ã³ããã§åããã¦ã¿ã docker
ã³ã³ããã使ããã¨ã§ã»ã¼ç°å¢ãåãããæ軽㫠web ãµã¤ãã®ã¬ã¹ãã³ã¹ã¿ã¤ã ãç£è¦ãè¨æ¸¬åºæ¥ãããã«ãªããã¢ããªããã¨ããä¼ã¿
åè
- Kibana 3 + Rails + Fluentdã®ãµã³ãã«ã¢ããªãä½ã£ã¦ã¿ã
- 第2åelasticsearchåå¼·ä¼ã§Kibanaã®çºè¡¨ããã¦ãã¾ãã #elasticsearchjp
- siegeã®ã¤ã³ã¹ãã¼ã«ãè¨å®ã¨ä½¿ãæ¹
- siege
ãããã¨
ãããã¨ã¯ä»¥ä¸ã®ãããªæãã
docker pull inokappa/wheezy-siege
ã§ã³ã³ãããåå¾docker
ã³ã³ãããèµ·åãã¦å¿ è¦ãªãµã¼ãã¹ãèµ·åãã- ç£è¦ã®éå§
ã³ã³ããã®æºå
ã³ã³ãããåå¾
ååã®è¨äºã§ä½æããã³ã³ããã¤ã¡ã¼ã¸ãã¨ããããå©ç¨ããã
æ¹ãã¦ä½ããªãããã³ã³ããã¤ã¡ã¼ã¸ã pull ãã¦ããã
docker pull inokappa/wheezy-7.2-siege
ãããã³ã³ããã¤ã¡ã¼ã¸ã使ããªãå ´åã«ã¯ãã¡ãã® cookbook ã使ã£ã¦ãã¨ããããã¯ãããã¯ãã
ã³ã³ãããèµ·å
以ä¸ã®éãã³ã³ãããèµ·åããã
docker run -i -t -p 80:80 -p 9200:9200 inokappa/wheezy-7.2-siege /bin/bash
ã¨ãããã kibana
ç¨ã« 80
çªãã¼ããelasticsearch-head
ç¨ã« 9200
çªãã¼ããéæ¾ããã
ã³ã³ããå ã®å¿ è¦ãªãµã¼ãã¹ãèµ·å
å¿ è¦ãªãµã¼ãã¹ãã³ã³ããã«ãã°ã¤ã³ãã¦èµ·åããã
/etc/init.d/nginx start /etc/init.d/elasticsearch start /etc/init.d/cron start
å°ãcron
ã¯èµ·åãã¦ããªãã®ã§å¿ããã«èµ·åãããã¨ã
ã¬ã¹ãã³ã¹ã¿ã¤ã ç£è¦ã®éå§
ã¬ã¹ãã³ã¹ã¿ã¤ã ã®ç£è¦ã«ã¯åè¿°ã®éã siege
ãå©ç¨ããã
siege ã®ã¤ã³ã¹ãã¼ã«
以ä¸ã®ããã«ãµã¯ã㨠siege
ãã¤ã³ã¹ãã¼ã«ããã
apt-get install siege
siege
ã«ã¤ãã¦è©³ãããã¨ã¯ãã¡ããã覧ä¸ããã¾ã...
ã¬ã¹ãã³ã¹ç£è¦ã®ã·ã§ã«ã¹ã¯ãªãã
siege
ã使ã£ã¦ç¹å®ã® Web ãµã¤ãã®ã¬ã¹ãã³ã¹ãã§ã¯ãããå¾ã§ elaticsearch
ã«ã¬ã¹ãã³ã¹ã¿ã¤ã ããã¹ãããã·ã§ã«ã¹ã¯ãªãããæ¸ãã¦ã¿ãã
#!/bin/bash _index=logstash-`date +%Y.%m.%d` _type=response _name=hoge.huga.com logdate=`date +%Y-%m-%d` timestamp=`date +%H:%M:%S` # /usr/bin/siege -b -i -r 5 -c 5 http://hoge.huga.com --log=/tmp/test_log result=`tail -n1 /tmp/test_log` response_time=`tail -n1 /tmp/test_log | awk '{print $4}' | sed s/,//g` echo $result echo $response_time # _document=`date +%s` # curl -XPUT "http://localhost:9200/$_index/$_type/$_document" -d \ '{"response_time" : '$response_time' ,"@log_name" : "'$_type'-'$_name'", "@timestamp" : "'$logdate'T'$timestamp'+0900"}'
cron
ã«ãã®ã¹ã¯ãªãããå®æçã«å®è¡ããããã«è¨å®ããã
ã¬ã¹ãã³ã¹çµæã®ç¢ºèª
æ«ãããã¨ä»¥ä¸ã®ããã«ã³ã³ããä¸ã® kibana
ã«ã¦ã¬ã¹ãã³ã¹ã¿ã¤ã ãã°ã©ãåããã¦ãã
ã¾ããelasticsearch
ã¸ã®æãæ¹ã工夫ããã°ãå°ãåã£ã解æãåºæ¥ããããããªãã
æå¾ã«
- ããããã¤ã³ã¹ãã¼ã«ãç°¡åãª
elasticesearch
ãkibana
ãDocker
ã³ã³ããåããå¿ è¦ãæããã¯ã好ã¿ã§.... cron
ãã¼ã¢ã³ããã¼ã«ã«ã¿ã¤ã çã®è¨å®ã«ã注æãã- Growthforecast ã®æ¹ãããæ軽ã«åºæ¥ãã¨ã¯æã
siege
ã®ãã°ã解æãã¦elasticsearch
ã«æããã®ãfluentd
ã«ãã¦ãã¾ããã