å ¥åºåãã©ã°ã¤ã³ãrubyã§æ¸ããã®ããã¤ã«ããæãã® fluentd ãããæãã«è¦ããã
ã®ã§ä½¿ãããã©ããã使ããã¨ãããã©ããããã®ãã¼ããç¨æããã°ããã®ãã«ã¤ãã¦èãããããã¨ãããããã³ããã¼ã¯ãã¨ã£ã¦ã¿ãã
çµè«
以ä¸é常ã«é·ããªãã®ã§çµè«ã ãæ¸ãã¨ã大å¤ä½¿ããæããç¾ç¶ã ã¨ã»ã¨ãã©ä½ãèããã«ãã¼ã¿ä¸ç¶ããã¦ãç§é1ä¸ã¡ãã»ã¼ã¸ã100Mbpsãããã¾ã§ã¯å¦çã§ãããå¹çãããªãããæµãå´ãèãã¦ããã° 300Mbps ãè¶
ãããã¼ã¿ã®è»¢éã«æåãããã ãã¶ããæãã
ãªããã㯠in_scribe ããã³ out_scribe ã使ç¨ããå ´åã§ãéçºè
@frsyuki ã«ããã¨MessagePackã§ã®ãã¼ã¿è»¢éã®å ´åã¯ãã®åãããåºããããã
ãã¡ããããã¯å³ããå·¦ã«æµããã ããªã®ã§ç¾å®ã«ã¿ã°ã«ããã«ã¼ãã£ã³ã°ã ã¨ããã°ä¸ã®æéã«ããåºåå å¤æ´ã ã¨ããããããããããã¨ãã£ã¨ä¸ãã£ã¦ããã®ã¯ç¢ºãã ããããããã®ã¸ãã®åé¡ã«ã¯maxã§ããã ãåºãã®ãããã£ã¦ããã°ãããã§ã対å¦ã®ããããããã®ã§ãå åå®ç¨ã«èããæ°å¤ã ã¨æãã
以ä¸è©³ç´°ã«ã¤ãã¦ã
ãã³ããã¼ã¯ç°å¢
ãã³ããã¼ã¯ã¯è² è·ããããå´ããã³ãããããå´(fluentd)ã¨ãã«ä»¥ä¸ã®ãµã¼ãã使ã£ãã
ãªãã©ã¡ããGbEã§åãã¹ã¤ããã«æ¥ç¶ããã¦ããã
fluentd ã¯æå 0.10.6 ã使ã£ã¦ããããæåã®ãã³ããã¼ã¯çµæãtweetãã¦ã²ã¨æ©ãã£ããマルチプロセス化の機能が実装された 0.10.7 が出てã¦1.5ã4åé«éåãã¦ããã¨ããã話ã ã£ãã®ã§ããã£ã¡ã§ããä¸åº¦ã¨ã£ã¦ã¿ãã
ãã³ããã¼ã¯ã«ä½¿ç¨ããã¹ã¯ãªããé¡ã¯ä»¥ä¸ã®ãªãã¸ããªã«å
¨é¨ããããã ã¡ã¤ã³ã® scribe_load.sh ãfluentdã®è¨å®ãã¡ã¤ã« conf/fluentd.conf ã¯æ¸ãæããªãã使ã£ãã®ã§é©å®éå»ã®ç¶æ
ãåç
§ããã®ãããããã
tagomoris/fluentd-tester · GitHub
æ§æã®è©³ç´°ã¯ä»¥ä¸ã®éãã
- benchãµã¼ã
- scribe_load.sh å®è¡
- å®ä½ã¯rubyã®ã³ã¼ãã§ãäºåã«çæããscribeç¨ã®ãªãã¸ã§ã¯ããfluentdå®ã«æå®ã¬ã¼ãã§æãç¶ãã
- scribed åä½(fluentdã«è¡ã£ã¦æ»ã£ã¦ãããã¼ã¿ãHDDã«æ¸ãã ã)
- scribe_load.sh å®è¡
- fluentdãµã¼ã
- fluentd å®è¡
- in_scribe ã§æ¥ããã®ããã¹ã¦ out_scribe ã§benchãµã¼ãã§åä½ãã¦ããscribedå®ã«æãè¿ã
- fluentd å®è¡
両ãµã¼ãã®ç¶æ³ã¯ CloudForecast ã§è¨é²ãã¦ã¦ããªã½ã¼ã¹ä½¿ç¨ç¶æ³ãã¹ã«ã¼ãããã«ã¤ãã¦ã¯ãã®ãã¼ã¿ãåç §ãã¦ããã
æ§è½è¨æ¸¬ã®ææ¨ã«ã¤ãã¦
scribeãããã³ã«ã§ãã°ã¡ãã»ã¼ã¸ã®è»¢éãè¡ã以ä¸ããã®ããã©ã¼ãã³ã¹ã«ã¯ä»¥ä¸ã®ãããªè¦ç´ ã絡ãã§ãããã¾ãscribe(Thrift)以å¤ã®ãããã³ã«ã®å ´åã大æ ã§ã¯ãã®ãããèãããã¨ã¯åãã ã¨æãããã¹ã¦ç§ãããã®æ°ã¨ãããã¨ã«ããã
- RPCã¬ã¼ã(call/sec)
- å¤é¨ããfluentd(ã®in_scribe)ã«å¯¾ãã¦è¡ãããããã°ã¡ãã»ã¼ã¸è»¢éã®ããã®RPCå¼ã³åºãã®ç§ãããã®æ°ãMessagePackã®å ´åãåæ§ãHTTPã«ãããã°ã¡ãã»ã¼ã¸è»¢éã®å ´åã¯HTTPãªã¯ã¨ã¹ãæ°ãªã©ã®ææ¨ã«ããããä¸åº¦ã®RPCå®è¡ã«ã¯ãããªãã®ãªã¼ãã¼ãããããããã®ã§å°ãªãæ¹ãããããç¡çãã¦ä¸ãã¦ããããªãå ´åãããããã©ãããã
- RPCãããã®ã¡ãã»ã¼ã¸æ°(msg/call)
- ä¸åº¦ã®RPCã§è»¢éã§ããã¡ãã»ã¼ã¸æ°ãè¤æ°ã®å ´åããã®æ°ãåºæ¬çã«ã¯ãã£ã¡ãå¤ããã¦RPCã¬ã¼ããä¸ããæ¹ãæå¹ãªå ´åãå¤ã(RPCå¼ã³åºãã®ã³ã¹ãã¯æ®éãã®ç¨åº¦ã«ã¯é«ã)ããRPCã®å¼æ°ã¨ãªããã¼ã¿ãªãã¸ã§ã¯ãã巨大ã«ãªãã¨ãã®ãã¼ã¹ã«ä½è¨ãªè² è·ãããã£ããããã±ã¼ã¹ããããã©ããããã§æãæã¤ãã¯ãããã³ã«ãã¨ã«ç°ãªãã
- ã¡ãã»ã¼ã¸ãµã¤ãº(bytes/msg)
- 転é対象ã¨ãªããã°ã¡ãã»ã¼ã¸ã®å¹³åãµã¤ãºãèªåã転é対象ã¨ãããã¼ã¿ãµã¤ãºã«ãããã¦ãã³ããã¼ã¯ãã¨ãã¹ãããã ãããã§å åã«å¤§ãããµã¤ãº*1ã許容ãããå ´åã¯è¤æ°ã¡ãã»ã¼ã¸ãã²ã¨ã¤ã®ãã¼ã¿æ§é ã«ããã¯ããä¸ã§è»¢éã«ãããã¨ããæ¦ç¥ãã¨ããå¯è½æ§ãããã*2
- ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããã(msg/sec)
- ç§éã§å¦çå¯è½ãªã¡ãã»ã¼ã¸æ°ãåºæ¬çã«ã¯ãããåè² ã
- ãã¼ã¿è»¢éã¹ã«ã¼ããã(bytes/sec, Mbps)
- ç§éã§å¦çå¯è½ãªãã¼ã¿éãæçµçã«ã¯ãããåè² ã«ãªããã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããããè¦æ±ã«è¶³ããªãå ´åãè¤æ°ã¡ãã»ã¼ã¸ãã¾ã¨ãã¦1ã¡ãã»ã¼ã¸ã¨ãã¦è»¢éãããã¨ã§è«ççãªã¡ãã»ã¼ã¸è»¢éæ°ã稼ããã¨ãã§ãããããã¼ã¿è»¢éã¹ã«ã¼ãããã ãã¯é¨ãã®ãé£ãã*3ãéã«è¨ãã¨ããããå¿ è¦ãªã ãåºã¦ãããªãä½ããããããããããã¨è¦ã¦ããã
è¨èã§æ¸ãã¨ãããªæãã ãã以ä¸ã®ããã«ç°¡åãªå¼ã§è¡¨ããã
DataThroughput [bytes/sec] = MessageSize [bytes/msg] * MessageThroughput [msg/sec] MessageThroughput [msg/sec] = RPCRate [call/sec] * MessagesPerRPC [msg/call]
ã¾ãæ§è½ã«ã¤ãã¦ã¯ä»¥ä¸ã®ãããªä¸è¬åãããã(ãã¡ããä¾å¤ããããããã)
- ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã¯åºæ¬çã«CPUãã¯ã¼ããã³ã½ããã¦ã§ã¢ã®æ§é ã«ãã£ã¦æ±ºã¾ã
- ããã«ããã¯ã«ãªãå ´æã¯ã½ããã¦ã§ã¢ã®æ§é ã«ãã£ã¦ç°ãªãããã«ãããã»ã¹ã»ãã«ãã¹ã¬ããã«ãã£ã¦åä¸ããå ´åã¨ããªãå ´åããã
- éã«è¨ãã¨ããã«ãããã»ã¹ã»ãã«ãã¹ã¬ããåãã¦ãåä¸ããªãå ´åã¯ããããã®ã½ããã¦ã§ã¢ã®æ§é ä¸ã®éçã§ããå¯è½æ§ããã
- ãã¼ã¿è»¢éã¹ã«ã¼ãããã¯ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã¨ã¯ç¬ç«ã«å®ã¾ãå ´åãå¤ã
- 大ãããã¼ã¿ã§ããã°å½ç¶éä¿¡ã«æéããããããç¾ä»£çãªã³ã³ãã¥ã¼ã¿ã§ããã°ããã¯ãããã¯ã¼ã¯ããã¤ã¹ãOSã®ãããã¯ã¼ã¯ãã©ã¤ãã«ãã£ã¦ããã¯ã°ã©ã¦ã³ã(ãªããã¼ã)ã§å¦çããã
- ãã®ãããã½ããã¦ã§ã¢ãæ¢ã«CPUããã¯ã«ãªã£ã¦ããç¶æ ã§ãã1åã®å¦çãããã«éããã¼ã¿é(ã¡ãã»ã¼ã¸ãµã¤ãº)ãä¸ãã¦ãããã¨ã§å ¨ä½çãªãã¼ã¿è»¢éã¹ã«ã¼ãããã¯åä¸ããå¯è½æ§ãé«ã
ã¨ãããã¨ã§åºæ¬çãªæ¹éã¨ãã¦ã¯ä»¥ä¸ã®ããã«ãªãã
- ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã«ã¤ãã¦ã©ã®ç¨åº¦ãéçããã¾ãè¨æ¸¬ãã
- ãã®ã¨ãã¡ãã»ã¼ã¸ãµã¤ãºã¯æ¯è¼çå°ãã(ãã ãç¾å®çãªæ°å¤ããä¹é¢ããªãç¨åº¦)ã«ãã¦ãã
- ã¾ãRPCã¬ã¼ãã¨RPCãããã®ã¡ãã»ã¼ã¸æ°ãã©ã®ç¨åº¦ã®ãã©ã³ã¹ã«ããã®ãããããå¤ããªããè¨æ¸¬ããé½åã®ããããããæ¢ã
- ãã¼ã¿è»¢éã¹ã«ã¼ãããã®æ大å¤ãè¨æ¸¬ãã
- ãããæ¬å½ãæ大ã§ã©ã®ç¨åº¦ã®ãã¼ã¿è»¢éã¹ã«ã¼ããããåºããã確èªãã
- ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã®éçã¾ã§ä½è£ãããç¶æ
ã§ãã¼ã¿éãå¢ãããã¿ã¼ã³ã¨ãã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã®éçã«è¿ãç¶æ
ã§ãã¼ã¿éãå¢ãããã¿ã¼ã³ãããã¨ãã
- ããã«ããã¡ãã»ã¼ã¸ãµã¤ãºã®å¤§ããã« fluentd ã®ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããããå½±é¿ãåãããããã©ããããªãã¨ãªãããã
ãã³ããã¼ã¯ããããå´ã®ä¸¦å度ãä¸ãã£ãã¨ãã«ã©ããªããã¨ããæ°ã«ãªãå ´åã¯ãã§ãã¯ãã¦ããã¨ãããã ããããããªæãã
çµæ
ããããã表ã§ã¯ãã¹ã¦ä»¥ä¸ã®ããã«æ¸ãã
- ç®æ¨ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããã
- ç®æ¨msg/sec
- ã¡ãã»ã¼ã¸ãµã¤ãº
- bytes/msg
- RPCãããã¡ãã»ã¼ã¸æ°
- msg/call
- ç®æ¨RPCã¬ã¼ã
- call/sec
- ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããè¨æ¸¬å¤
- å®ç¸¾msg/sec
- ãã¼ã¿è»¢éã¹ã«ã¼ãããè¨æ¸¬å¤
- å®ç¸¾Mbps
ã¾ããªã½ã¼ã¹ã°ã©ããå·¦å³ã«ä¸¦ã¹ã¦ããã¨ããã§ã¯ãã¹ã¦å·¦å´ã benchãµã¼ã ã§å³å´ã fluentdãµã¼ãã
äºåè¨æ¸¬: scribeã«ãããRPCã¬ã¼ãã¨RPCãããã¡ãã»ã¼ã¸æ°
fluentd 0.10.6 ã対象ã«æåã«ãã³ããã¼ã¯ãã¨ã£ãã¨ã*4ã¯ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããããRPCãããã¡ãã»ã¼ã¸æ°ã¨ç®æ¨RPCã¬ã¼ãã®ãã©ã³ã¹ããã¼ã¿è»¢éã¹ã«ã¼ããããã®ãããããè¨æ¸¬ãããã ãã©ããã®ã¨ãã®çµæããã³ãªã½ã¼ã¹ã°ã©ãã¯ä»¥ä¸ã®éãã
ã¡ãã»ã¼ã¸è»¢éã¬ã¼ãè¨æ¸¬
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s | å®ç¸¾Mbps |
---|---|---|---|---|---|
1000 | 100 | 50 | 20 | 971 | 1Mbps |
4000 | 100 | 100 | 40 | 3924 | 4Mbps |
11000 | 100 | 183 | 60 | 10147 | 10Mbps |
16000 | 100 | 200 | 80 | 11222 | 11Mbps |
ç®æ¨16000msg/s ã«ãããRPCãããã¡ãã»ã¼ã¸æ°ã¨ç®æ¨RPCã¬ã¼ãã®ãã©ã³ã¹ç¢ºèª
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s | å®ç¸¾Mbps |
---|---|---|---|---|---|
16000 | 100 | 50 | 320 | 10160 | 10Mbps |
16000 | 100 | 100 | 160 | 10698 | 10Mbps |
16000 | 100 | 200 | 80 | 11280 | 11Mbps |
16000 | 100 | 400 | 40 | 11702 | 11Mbps |
16000 | 100 | 800 | 20 | 11911 | 12Mbps |
ç®æ¨10000msg/s ã«ãããã¡ãã»ã¼ã¸ãµã¤ãºå¤æ´ã«ãããã¼ã¿è»¢éã¹ã«ã¼ãããè¨æ¸¬
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s | å®ç¸¾Mbps |
---|---|---|---|---|---|
10000 | 50 | 200 | 50 | 9753 | 6Mbps |
10000 | 100 | 200 | 50 | 9739 | 10Mbps |
10000 | 200 | 200 | 50 | 9683 | 18Mbps |
10000 | 400 | 200 | 50 | 9530 | 34Mbps |
10000 | 800 | 200 | 50 | 9136 | 62Mbps |
(ã°ã©ãã¯ã¿ã£ã¤è¦ãã¦ããé·æéã®å±±ãããããã®ãã¹ãã«å¯¾å¿ãããæéé åºã¯ä¸è¨ã«ä¸¦ã¹ãé çªã§å®è¡ããã左端ã®å°ããªå±±ã¯æ¼éã«ãã£ãå®é¨ã®ãã®ã§é¢ä¿ãªãã)
ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããã㧠11000msg/s ã¨ããã®ãã²ã¨ã¾ãã®æ°å¤ã§ãã¼ã¿è»¢éã¹ã«ã¼ãããã¯ã¾ã ä¸éè¦ããªããªã¼ã¨ãããããããã ãCPU使ç¨çãè¦ãã¨1ã³ã¢ããã«ã«ä½¿ã£ãæ°å¤(12.5%)ã«å±ãã¦ããªãã®ãæ°ã«ãªãã¨ããã°æ°ã«ãªãããããã®ãããã¯çµå±ç¿æã«ã¯ fluentd 0.10.7 ãåºã¦ã»ã¨ãã©æå³ããªããªã£ãã®ã§ãã¾ãèããªããã¨ã«ãããã
ã¡ãã£ã¨é¢ç½ãã®ãRPCãããã®ã¡ãã»ã¼ã¸æ°ã¨ç®æ¨RPCã¬ã¼ãã«é¢ãããã¼ã¿ãããªãæ´¾æã«ãã©ã³ã¹ãããã£ãã®ã«çµå±ã»ã¨ãã©å¤ãã£ã¦ãªããããã¯ã¤ã¾ãThriftãããã³ã«ä¸ã®åé¡(RPCãThriftãªãã¸ã§ã¯ãã®ãã¼ã¹ã®ä¸¡æ¹)ããããfluentå
é¨ã®ã¡ãã»ã¼ã¸å¦çã®æ¹ãã¯ããã«éãã¦Thriftãããã³ã«ã®è² è·ãã©ã£ã¡å´ã«æ¯ããã¯ã©ãã§ããããã¨ãããã¨ã ãããã
fluentdå
é¨ã§ã¯ã¡ãã»ã¼ã¸åä½ã§ Engine.emit() ãå¼ã°ãã¦ããã¯ããªã®ã§ãããã®éããæ¯é
çã ã¨ãããªããã®ãããªæåããªãã¨ãªãç´å¾ã§ããã
ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããããã¼ã¿è»¢éã¹ã«ã¼ããã
ãã以é㯠fluentd 0.10.7 ã«ã¢ãããã¼ããã¦ããã®çµæã
ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã«ã¤ãã¦ã©ã®ç¨åº¦ãéçããæ¢ããã fluentd ã®è¨å®ã以ä¸ã®ããã«ãã¦ãã³ããã¼ã¯ããããã
- in_scribe
- detach_process 2
- out_scribe
- detach_thread 4
çµæã¯ãã®ãããªæãããã¹ã¦60åãã¤èµ°è¡ãããè¨æ¸¬å¤ã¯ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã®å®ç¸¾å¤ã
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s |
---|---|---|---|---|
4000 | 100 | 100 | 40 | 3860 |
8000 | 100 | 133 | 60 | 7734 |
16000 | 100 | 200 | 80 | 15578 |
24000 | 100 | 240 | 100 | 18093 |
RPCã¬ã¼ããä¸ãã¦ããã¨ã ããã 18000 msg/s ã«éããã¨ããã§éçããããåã«ãã£ã 0.10.6 ã®æ°å¤ 11000msg/s ã®1.5å以ä¸åºã¦ããããã¼ã¿è»¢éã¹ã«ã¼ãããã§ã¯ã¡ãã»ã¼ã¸ãããã®ãµã¤ãºãå°ããã®ã§ 20Mbps ç¨åº¦ããåºã¦ããªãã®ã§æ°å¤ã¯çç¥ã
ã¾ããã¼ã¿è»¢éã¹ã«ã¼ãããã®è¨æ¸¬ããç®æ¨ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããã 10000 msg/s 㨠15000 msg/s ã®2éãã®èµ°è¡ã§ç¢ºèªããããã¼ã¿è»¢éã¹ã«ã¼ãããã®è¨æ¸¬å¤ã¯ã°ã©ãããèªã¿ã¨ã£ããã®ãªã®ã§ããªã大éæ*5ãfluentdã®è¨å®ã¯åã®ã¨åããããã60åãã¤ã®èµ°è¡ã«ãã¦ããã
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s | å®ç¸¾Mbps |
---|---|---|---|---|---|
10000 | 200 | 200 | 50 | 9658 | 20Mbps |
10000 | 400 | 200 | 50 | 9802 | 40Mbps |
10000 | 800 | 200 | 50 | 9800 | 75Mbps |
10000 | 1200 | 200 | 50 | 9711 | 100Mbps |
15000 | 200 | 300 | 50 | 14562 | 28Mbps |
15000 | 400 | 300 | 50 | 14696 | 55Mbps |
15000 | 800 | 300 | 50 | 14583 | 100Mbps |
15000 | 1200 | 300 | 50 | 13870 | 145Mbps |
ãããè¦ãéãã10000msg/sã«æãã¦ããéãã¯ãã¡ãã»ã¼ã¸ãµã¤ãºã«å¯¾ãã¦ã»ã¼ãªãã¢ã«ãã¼ã¿è»¢éã¹ã«ã¼ããããä¸ãã£ã¦ãã£ã¦ããã対ãã¦15000msg/sãç®æ¨ã«ããã¨ã¡ãã»ã¼ã¸ãµã¤ãºã1200bytesãããã§å°ã ãã¤ããªãããã ãã¨ã¯ããå°ããã¤ããªã£ãããªãããã§ãå®éã«ãã£ã¦ã¿ãã¨ã¾ã ä¸ãããããªæ°é ãããã
(å·¦å´ã«è¦ãã¦ããã®ã¯åæ¥ã®è©¦é¨åããã¾è¦ããã®ã¯å³å´ã«ã¿ã£ã¤è¦ãã¦ããå±±ã®ã¨ããã)
ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã«ã¤ãã¦ã¯CPU1ã³ã¢ã使ããã£ãä»è¿(使ãããæåï¼)ã§éçãè¿ãã¦ãã¦ãã以ä¸ã¯ã©ãã«ããªããªãããã«è¦ãããThriftã®å¦çãããã«ããã¯ã«ãªã£ã¦ãããªããã㧠in_scribe ã®ãã«ãããã»ã¹åã®å¹æãã¯ã£ããè¦ããã¯ãã ããæ®å¿µãªãããããªã£ã¦ããªãããã®ãããªç¶æ³ã ã¨ããã¾ãæå³ããªãããã ã
ã¨ã¯ããç§é18000ã¡ãã»ã¼ã¸ã¨ããã®ã¯ããªãããæ°åã ã¨æãããããããåºã¦ãããã¨ç¾å®çãªãã¼ãæ°ã§å¦çã§ããäºæããã£ã¨é«ã¾ãã
ãã¼ã¿è»¢éã¹ã«ã¼ãããéçè¨æ¸¬
çµå±åã®è¨æ¸¬ã§ãã¼ã¿è»¢éã¹ã«ã¼ãããã®ä¸éãè¦ããªãã£ãã®ã§ãåæ¡ä»¶30åèµ°è¡ã«ãã¦ä¸éãæ¢ã£ã¦ã¿ããåã®è©¦é¨ã§fluentdå´ã®CPUã³ã¢ã使ãããã¦ããªãã£ãã®ãæããã ã£ãã®ã§ãè¨å®ã¯ä»¥ä¸ã®ããã«å¤æ´ããã
- in_scribe
- detach_process 6
- out_scribe
- detach_thread 8
ãã®fluentdã«å¯¾ãç®æ¨ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã 15000msg/s 㨠20000 msg/s ã®2éããã¡ãã»ã¼ã¸ãµã¤ãºããã¤ã£ã¨æ大4800bytes/msgã¾ã§ä¸ãã¦ã¿ãã
ç®æ¨msg/s | bytes/msg | msg/call | call/sec | å®ç¸¾msg/s | å®ç¸¾Mbps |
---|---|---|---|---|---|
15000 | 600 | 300 | 50 | 14458 | 80Mbps |
15000 | 1200 | 300 | 50 | 13692 | 150Mbps |
15000 | 2400 | 300 | 50 | 11142 | 240Mbps |
15000 | 4800 | 300 | 50 | 7783 | 340Mbps |
20000 | 600 | 400 | 50 | 16211 | 90Mbps |
20000 | 1200 | 400 | 50 | 13756 | 150Mbps |
20000 | 2400 | 400 | 50 | 10856 | 230Mbps |
20000 | 4800 | 400 | 50 | 7978 | 350Mbps |
ãã®ã¨ãã®å種ã°ã©ãã¯ä»¥ä¸ã®éãã(å³ç«¯ã®ãµãã¤ã®å±±ã)
ãã®ã¨ãbenchãµã¼ãå´ã®iowaitãåºã¦ãããã¨ããæçµçãªåãåãæã®scribedãããã«ããã¯ã«ãªã£ãå¯è½æ§ãããã®ã§ãfluentdèªä½ã®å¦çæ§è½ã¨ãã¦ã¯å®éã«ã¯ãã£ã¨ã¹ã«ã¼ããããåºããããããªããã¾ããã®ã¨ãã¯ã¡ã¢ãªã«åããåºãããã£ã±ãåºåå ãè©°ã¾ã£ã¦ãããã¡ã«æºã¾ã£ãã®ããåã«æ±ããã¼ã¿ãµã¤ãºã大ãããªã£ãããå¢ããã®ãã¾ã§ã¯è¦ã¦ããªããã¾ããç¹ã«åé¡ãªãã¬ãã«ã
ãããã«ã¡ãã»ã¼ã¸ãµã¤ãºãåã«ãããã¨ã«ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ããããè½ã¡ã¦ããããããã¾ã§æ¥æ¿ã«è½ã¡ãããã§ããªããçµæã¨ãã¦ãã¼ã¿è»¢éã¹ã«ã¼ãããã¯ä¸ããã¤ã¥ãã¦350Mbpsãè¨é²ãããããã¯ããããããã ãåºãã¨æ®éã®ç¨éã§ã¯å åã¨è¨ã£ã¦ããã¨æããã¨ããããã以ä¸åºãã¨ãããã¯ã¼ã¯ã¾ãããçé¢ç®ã«è¦ãå¿ è¦ãè¿ä»ãã¦ããã
ã¨ã¯ããCPUã¯çµå±åã¨åæ§ã«ãã¾ã使ããããã¨ããæãã§ããªããæãä½ã«è¨ã£ã¦1ã³ã¢ã使ããã£ãããã(12.5%)ä»è¿ã§éçãè¿ãã¦ããããã«è¦ãããå®ã¯ in/out ã®ãã«ãããã»ã¹ã»ãã«ãã¹ã¬ããåã¯ä»åã®ãã³ããã¼ã¯ã®ç¯å²ã§ã¯å ¨ãå¹æããªãã£ãããããªããããã¨ããæããããã¼ãã
çµè«
fluentdã®ã¡ãã»ã¼ã¸å¦çèªä½ã¯ç¾ç¶CPU1ã³ã¢ã«å¦çã§ããåãããããæ大ã§ãä»å使ã£ããµã¼ãã ã¨ã ããã18000msg/secããããéçå¤ã®ããã«æãããç¾ç¶æ±ã£ã¦ãã(ãããã¯å°æ¥çã«æ±ãè¦è¾¼ã¿ã®)ã¡ãã»ã¼ã¸æ°ããããè¶ ããå ´åã1å°ã®fluentdã§ã¯ãããã«å¦çããããªãã¨ãããã¨ã«ãªã£ã¦ãã¾ãâ¦â¦ã ãããæ®å¿µãªããã
ãã ããã¼ã¿è»¢éã¹ã«ã¼ãããèªä½ã¯ããªãã®éã¾ã§èæ§ãããããã ãã1ã¡ãã»ã¼ã¸ãããã®ãµã¤ãºãç´4.8KBã«ãã¦ããããªãã«ã¹ã±ã¼ã«ãããããªã®ã§ãå ¨ä½çã«ã¡ãã»ã¼ã¸æ°ãå¤ãå ´åã¯éåºå ã®å´ã§è¤æ°ã¡ãã»ã¼ã¸ãã²ã¨ã¤ã®ã¡ãã»ã¼ã¸ã«ããã¯ãã¦ããfluentdã«éãã¨ãã£ãããã¯ãããã¨æ¥µãã¦ããã¹ã±ã¼ã«ããããã®æ¦ç¥ã¯å¤§è¦æ¨¡ãªfluentdã¯ã©ã¹ã¿ãè¨è¨ããäºå®ããããªããããããèãã¦ããã¦æã¯ãªããèªåã¯ãã®æ¦ç¥ãããªã極端ã«ã¨ãã¤ããã
å
¥åºåãã©ã°ã¤ã³ã®ãã«ãããã»ã¹ã»ãã«ãã¹ã¬ããåã«ã¤ãã¦ã¯ããã©ã°ã¤ã³å´ã§ã©ã®ç¨åº¦ã®å¦çããããã¨ãããã¨ã«ããã£ã¦ãããå°ãªãã¨ãThriftãããã³ã«ã®å¦çãããã§ã¯ãã¾ãå¹æããªãããããfluentdã®ã³ã¢å´ãããã«ããã¯ã«ãªã£ã¦ããæ°ãããã0.10.6ãã0.10.7ã§ã®é«éåã¯ãããæ¹åãããããã ããå¤åã
ã¨ã¯ãããã©ã°ã¤ã³å´ã§éãå¦çãããã±ã¼ã¹ããããªãã«èãããã*6ãã¨ãããå°æ¥çã«ãã®ãªãã·ã§ã³ãæå³ç¡ãã¨ãããã¨ã¯ã¾ãç¡ãã¨æãã
ã©ããã¦ãç©çãµã¼ã1å°ãããã®ã¡ãã»ã¼ã¸è»¢éã¹ã«ã¼ãããã稼ãããå ´åã¯fluentdèªä½ãè¤æ°ããã»ã¹ä¸ãããã¨ãèããããããããªã«éç¾å®çãªæ¡ã§ããªããããããªãã
å ¨ä½çã«ã¯ç¾ç¶ fluentd 0.10.7 ã«ããªãæºè¶³ãããããã¼ã«ä½¿ã£ã¦ãåé¡ãªããããªããã©ã¼ãã³ã¹ãåºã¦ããã¨æããåé·åãèãã¦ã2ã3å°ã®ãµã¼ããããã°ã¡ãã»ã¼ã¸è»¢éã¨ãã¼ããã©ã³ã¹ã¯ãããã¨æãããã£ãããã£ããã
*1:ãã¨ãã°å ¸åçãªé信対象ãã¼ã¿ã®æ°åãæ°åå
*2:RPCå¼ã³åºãããã³ãã¼ã¿ãªãã¸ã§ã¯ãã®ãã¼ã¹ã«CPUãé£ããããªãããã³ã«ã®å ´åã¯ãã®ãããªæ¦ç¥ã«ãããæçµçãªãã¼ã¿è»¢éã¹ã«ã¼ããããå¤§å¹ ã«ä¸ããããã
*3:転é対象ã®ãã¼ã¿ãå§ç¸®ããã¨ããæããããããããã¨ããã©ãããã®ã§ããã¾ããããããªã
*4:ããããäºåè¨æ¸¬ã¨ããããããã£ãæç¹ã§ã¯ææ°ç 0.10.6 ã«å¯¾ããæ¬çªè¨æ¸¬ã ã£ããã ãã©â¦â¦ã
*5:éã«è¨ãã¨ããããªã«ç´°ããæ°å¤ã¨ã£ã¦ããããããªã
*6:ãã®ããã«ãã©ã°ã¤ã³ãæ¸ããããfluentdã使ããã ããã