ããã«ã¡ã¯ãäºæ¥æ¨é²æ¬é¨SEé¨ã®æ¨ªç°ã§ãã
ä»åã¯IDCFã¯ã©ã¦ã ã³ã³ãããµã¼ãã¹ã«ããããªã¼ãã¹ã±ã¼ã«ã«ã¤ãã¦ç´¹ä»ãã¾ãã
- èæ¯ã¨ç®ç
- ç°å¢ç¢ºèª
- ç°å¢è¨å®
- åä½ãã¹ã
- ã¾ã¨ã
èæ¯ã¨ç®ç
IDCFã¯ã©ã¦ã ã³ã³ãã¥ã¼ãã§ã¯ãªã¼ãã¹ã±ã¼ã«ã®å°å
¥ã¯æéããããã¾ãããå®ã¯ã³ã³ãããµã¼ãã¹ã§ã¯ãã¼ãã®ãªã¼ãã¹ã±ã¼ã«æ©è½ãç°¡åã«ä½¿ãã¾ãã
æ¬ç¨¿ã§ã¯ä»¥ä¸ã®å
容ã«ã¤ãã¦è¨è¼ãã¦ãã¾ãã®ã§ãæ¯éãåèã«ãã¦ãã ããã
- ã¯ã¼ã¯ãã¼ãã®ãªã¼ãã¹ã±ã¼ã«å©ç¨æ¹æ³
- Worker ãã¼ãã®ãªã¼ãã¹ã±ã¼ã«å©ç¨æ¹æ³
åææ¡ä»¶
- Kubernetes ã®ãã¼ã¸ã§ã³ã 1.19 以ä¸ã§ãããã¨
- ã¯ã©ã¹ã¿ã®æ§æã Master ãã¼ãã¨ãWorkerãã¼ãã§åé¢ããã¦ãããã¨
æ§æã¤ã¡ã¼ã¸
ã¹ã±ã¼ã«ã¢ã¦ãæã®ç¶æ é·ç§»ã¤ã¡ã¼ã¸ã¯ä»¥ä¸ã®æµãã«ãªãã¾ã
- åºæ¬æ§æ
- ã¯ã¼ã¯ãã¼ã ãªã¼ãã¹ã±ã¼ã«
- Worker ãã¼ã ãªã¼ãã¹ã±ã¼ã«
åºæ¬æ§æ
åæç¶æ
ã¨ã㦠Podã¯æå°ã®1å°ã§ãã
ã¯ã¼ã¯ãã¼ãã®ãªã¼ãã¹ã±ã¼ã«æã®ã¤ã¡ã¼ã¸
è² è·ãæããäºã§ãPodãèªåçã«ã¹ã±ã¼ã«ã¢ã¦ãããã¾ãã
Workerãã¼ãã®ãªã¼ãã¹ã±ã¼ã«æã®ã¤ã¡ã¼ã¸
ã¯ã¼ã¯ãã¼ããã¹ã±ã¼ã«ã¢ã¦ããããæã«ãã¼ãã®ãªã½ã¼ã¹ãä¸è¶³ããå ´åãWorker ãã¼ããèªåçã«ã¹ã±ã¼ã«ã¢ã¦ãããã¾ãã
ç°å¢ç¢ºèª
ãªã¼ãã¹ã±ã¼ã«ç°å¢ãä½ã£ã¦ããã¾ãã
ã¯ã©ã¹ã¿ã®è¨å®ç¢ºèª
ã¯ã©ã¹ã¿ã®æ§æãåææ¡ä»¶ãæºããã¦ããã確èªãã¾ãã
- master ãã¼ã㨠worker ãã¼ãã§åé¢ããã¦ãããã¨
- Kubernetes ã®ãã¼ã¸ã§ã³ã [v1.19] 以ä¸ã§ãããã¨
â»worker ãã¼ã㯠worker ã®å½¹å²ã®ã¿ã§ããå¿ è¦ãããã¾ãã
ã¯ã©ã¹ã¿IDããã¼ããã¼ã«IDã®ç¢ºèª
cluster-autoscaler è¨å®ãè¡ãéã«å¿ è¦ãªæ å ±ã確èªãã¾ã ã¯ã©ã¹ã¿ããããã¼ãããéããworker ãã¼ãã«å²ãå½ã¦ããã¦ããIDã確èªãã¾ãã
- cluster idï¼
c-xxxxx
- node pool idï¼
np-xxxxx
â»ä»åã¯ãã¼ããã¼ã«ã®æå®ã¯è¡ãã¾ããããã¹ã±ã¼ã«å¯¾è±¡ã¨ãã¦ãã¼ããã¼ã«ãæå®å¯è½ã§ãã
ããã¼ããã¼ã«ãæå®ããå ´åã¯ãã¼ããã¼ã«IDã確èªãã¦ããã¾ã
ç°å¢è¨å®
ãããã ãªã¼ãã¹ã±ã¼ã«ã®è¨å®æé ãç´¹ä»ãã¾ãã
ããã§ã¯ CPU使ç¨çãå
ã«ãªã¼ãã¹ã±ã¼ã«ããè¨å®ãè¡ã£ã¦ãã¾ãã
API & ãã¼
ç»é¢å³ä¸ã®ã¢ã¤ã³ã³ãããAPI & ãã¼ããã¯ãªãã¯ã㦠APIãã¼ã追å ãã¾ãã
- 詳細æ
å ±ï¼
ä»»æã®å称
- èªåã§ã®å¤±å¹æ¥è¨å®ï¼
ããªã
- ã¹ã³ã¼ãï¼
ã¹ã³ã¼ããªã
ä½æããã APIãã¼ã®æ
å ±ãã¡ã¢å¸³çã«æ§ãã¦ããã¾ãã
ã«ã¿ãã°ã®è¿½å
- ç»é¢å·¦ä¸ããããDefaultãããã¸ã§ã¯ããé¸æ
- ããã¼ã«ã>ãã«ã¿ãã°ããã¯ãªãã¯ãã¾ã
- ãcluster-autoscalerããã¯ãªãã¯ãã¾ã
cluster-autoscaler ã®è¨å®
cluster-autoscaler ã«ã¿ãã°ã®è¨å®ãè¡ã£ã¦ããã¾ãã
以ä¸ã§ã¯å¿
è¦æä½éã®ã¿è¨å®ãè¡ã£ã¦ãã¾ãã
åå空é
- åå空éï¼
default
- Helm Waitï¼
å¤æ´ãªã
- Helm Timeoutï¼
å¤æ´ãªã
CLUSTER AUTOSCALER IMAGE REPOSITORY IMAGES SETTINGS
- Imageï¼
å¤æ´ãªã
- Image Tagï¼
å¤æ´ãªã
- ImagePullPolicyï¼
å¤æ´ãªã
CLUSTER AUTOSCALER DEPLOYMENTS SETTINGS
- Deployments Replicasï¼
å¤æ´ãªã
- Scan Intervalï¼
å¤æ´ãªã
- klog Verbose levelï¼
å¤æ´ãªã
- Rancher Client Debugï¼
å¤æ´ãªã
CLUSTER AUTOSCALER SETTINGS
- ClusterIdï¼
c-xxxxx
â»ãäºå確èªãã§ç¢ºèªããã¯ã©ã¹ã¿IDãå ¥åãã¾ã - API URLï¼
å¤æ´ãªã
- Token Keyï¼
APIãã¼ä½ææã® "Bearer ãã¼ã¯ã³"
â»ãAPI & ãã¼ãã§ä½æãããBearer ãã¼ã¯ã³ããå ¥åãã¾ãã - Min Size(Common)ï¼
3
- Max Size(Common)ï¼
6
â»ä»åã¯æå°å°æ°ï¼ï¼æ大å°æ°ï¼ãã¨ãã¦è¨å®ãè¡ãã¾ãã
CLUSTER AUTOSCALER SETTINGS (TARGETNODEPOOLS)
- NodePool Nameï¼
å¤æ´ãªã
- Min Sizeï¼
å¤æ´ãªã
- Max Sizeï¼
å¤æ´ãªã
â»ä»åã¯ãã¼ããã¼ã«ã§ã®æå®ã¯è¡ãã¾ããã
cluster-autoscaler ã¹ãã¼ã¿ã¹ã®ç¢ºèª
cluster-autoscaler ä½æå®äºå¾ãç¶æ
ããActiveãã§ãããã¨ã確èªãã¾ãã
cluster-autoscaler ã¯ã¼ã¯ãã¼ãã®ç¢ºèª
ã¯ã¼ã¯ãã¼ããã cluster-autoscaler ã®ã¯ã¼ã¯ãã¼ããä½æããã¦ããäºã確èªãã¾ãã
HPAï¼Horizontal Pod Autoscalerï¼è¨å®
ãã¹ãç¨ã¯ã¼ã¯ãã¼ãã®ãããã¤
ãã¹ãç¨ã« phpinfo ã確èªåºæ¥ã pod ãç¨æãã¾ãã
ä½ææã«è©³ç´°è¨å®ãã ãCPUäºç´ãã 1000 ããªCPU ã¨ãã¦ãããã¤ãã¾ãã â»1000ããªCPU ãæå®ãããã¨ã§ 1ã³ã¢äºç´ããã¾ãã
HPAè¨å®
ããã¸ã§ã¯ããDefautlãããããªã½ã¼ã¹ã>ãHPAããã¯ãªãã¯ãã¾ãã
ãHPA ã追å ããã¯ãªãã¯ãã¾ãã
ãæ°´å¹³ããããªã¼ãã¹ã±ã¼ãªã³ã°ãç·¨éãããè¨å®ãè¡ãã¾ãã
â»ä»åã¯HPAã®å¯¾è±¡ã¨ãã¦ãå
ã»ã©ä½æããããã¹ãç¨ã¯ã¼ã¯ãã¼ãããæå®ãã¦ãã¾ã
- ååï¼
phpinfo
â»ä»»æã®å称 - åå空éï¼
deault
â»ãªã¼ãã¹ã±ã¼ã«ããããã¯ã¼ã¯ãã¼ããåå¨ããåå空éãæå® - ã¯ã¼ã¯ãã¼ãï¼
phpinfo
â»ãªã¼ãã¹ã±ã¼ã«ããããã¯ã¼ã¯ãã¼ããæå® - æå°ã¬ããªã«æ°ï¼
1
- æ大ã¬ããªã«æ°ï¼
20
ã¡ããªãã¯å¤ãè¨å®ãã¾ã
- ã¡ããªãã¯ã¿ã¤ãï¼
ãªã½ã¼ã¹
- ã¡ããªãã¯åï¼
CPU
- ã¿ã¼ã²ããã¿ã¤ãï¼
å¹³å使ç¨ç
- æ°éï¼
10
â»ä»åã¹ã±ã¼ã«ã¢ã¦ãããããããã«ç¹å¥å°ããå¤ã10ï¼ ãã¨ãã¦ãã¾ãããå®éã®ã·ã¹ãã ã§ã¯ãã©ããããä½è£ãæããã¦ã¹ã±ã¼ã«ããããå¤ãè¨å®ãã¦ãã ãã
ä½æããHPAè¨å®ããActiveãã§ãããã¨ã確èªãã¾ãã
åä½ãã¹ã
è² è·ãæããPodãã¹ã±ã¼ã«ã¢ã¦ããããªã½ã¼ã¹ã足ãããã¼ããã¹ã±ã¼ã«ã¢ã¦ãããããã¨ã確èªãã¦ããã¾ãã
å®å ã¢ãã¬ã¹ã®ç¢ºèª
ãããã¤ããã¯ã¼ã¯ãã¼ãããå®å
ã¢ãã¬ã¹ã確èªãã¾ãã
è² è·ãã¹ã
ã¯ã©ã¹ã¿ã¼ç°å¢å¤ã«ããä»®æ³ãã·ã³ãã wrk ã³ãã³ããå©ç¨ããè² è·ãã¹ããè¡ã£ã¦ããã¾ãã
â»wrk ã³ãã³ãã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯æ¬ç¨¿ã§ã¯è¨åãã¦ãã¾ããã
以ä¸ã®ãã©ã¡ã¼ã¿ã§è² è·ãä¸ãã¾ãã
â»ç°å¢ã«ãã£ã¦ã¯ãã©ã¡ã¼ã¿ãé©å®å¤æ´ãã¦ãã¹ããã¦ãã ããã
- ã¹ã¬ããæ°ï¼
4
- ã³ãã¯ã·ã§ã³æ°ï¼
100
- ã¿ã¤ã ã¢ã¦ãï¼
300
- URLï¼
http://xxx.xxx.xxx.xxx
wrk -t 4 -c 100 -d 300 http://xxx.xxx.xxx.xxx/ Running 5m test @ http://xxx.xxx.xxx.xxx/ 4 threads and 100 connections
ã¯ã¼ã¯ãã¼ãã®ã¹ã±ã¼ã«ã¢ã¦ã
ã¯ã¼ã¯ãã¼ãã«è² è·ãæããäºã§ãPodãã¹ã±ã¼ã«ã¢ã¦ãããããã¨ã確èªãã¾ãã
ã¹ãã¼ã¿ã¹ç¢ºèª
Pod ãä¸å®æ°ã¹ã±ã¼ã«ã¢ã¦ããããã¨ãéä¸ããã¹ã±ã¼ã«ã¢ã¦ãããã Pod ã®ã¹ãã¼ã¿ã¹ããSchedulingãã«ãªããã¨ã確èªãã¾ãã
â»cluster-autoscaler ã§ã¯ãSchedulingãã¹ãã¼ã¿ã¹ãããªã¬ã¼ã«ããã¼ãã®ã¹ã±ã¼ã«ã¢ã¦ããè¡ãã¾ãã
Workerãã¼ãã®ã¹ã±ã¼ã«ã¢ã¦ã
ãã¯ã©ã¹ã¿ã>ããã¼ãããããworker ãã¼ãã追å ããã¦ããäºã確èªãã¾ãã
â»ä»¥ä¸ã¤ã¡ã¼ã¸å³ã§ã¯ãworker-4,5,6 ã追å ãããç°å¢æºåä¸ã®ç¶æ
ã¨ãªãã¾ãã
é 次ãã¹ãã¼ã¿ã¹ããActiveãã«ãªããã¨ã確èªãã¾ãã
ã¯ã¼ã¯ãã¼ãã®ç¢ºèª
ãªã½ã¼ã¹ã足ãããã¹ã±ã¼ã«ã¢ã¦ãã§ããªãã£ã Pod ãæ£å¸¸ã«ãããã¤ãèµ·åãã¦ããäºã確èªãã¾ãã
ã¯ã¼ã¯ãã¼ãã®ã¹ã±ã¼ã«ã¤ã³
5åå¾ wrk ã³ãã³ããå®äºãã¦ããäºã確èªãã¾ãã
wrk -t 4 -c 100 -d 300 http://xxx.xxx.xxx.xxx/ Running 5m test @ http://xxx.xxx.xxx.xxx/ 4 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 187.79ms 220.17ms 2.00s 84.12% Req/Sec 125.13 64.59 474.00 63.47% 124746 requests in 5.00m, 51.43GB read Socket errors: connect 0, read 185, write 3, timeout 256 Requests/sec: 415.67 Transfer/sec: 175.50MB
wrk ã³ãã³ããå®äºããã¨ãã¯ã¼ã¯ãã¼ãã®è² è·ãä¸ãããã¹ã±ã¼ã«ã¤ã³ãè¡ããã¾ãã
Pod ã®æ°ãå
ã®ãï¼ãåã«ãªã£ã¦ããäºã確èªãã¾ãã
Worker ãã¼ãã®ã¹ã±ã¼ã«ã¤ã³
ä¸å®æéå¾ãWorker ãã¼ããã¹ã±ã¼ã«ã¤ã³ããã¾ãã
â»ã¹ã±ã¼ã«ã¤ã³ãéå§ãããã¾ã§ç´10åç¨åº¦ãããã¾ãã
Worker ãã¼ããå
ã®ç¶æ
[3å°] ã«ãªã£ã¦ããäºã確èªãã¾ãã
ã¾ã¨ã
ä»å㯠ã³ã³ãããµã¼ãã¹ã«ããããªã¼ãã¹ã±ã¼ã«ã®å©ç¨æ³ã«ã¤ãã¦ç´¹ä»ããã¦ããã ãã¾ããã
IDCFã¯ã©ã¦ããæ©ããªã¼ãã¹ã±ã¼ã«ãå©ç¨ã§ããããã«ãªãã°ããã§ããï¼
ã³ã³ãããµã¼ãã¹ã®å©ç¨ãæ´»ç¨æ³ã«ã¤ãã¦ã¯ ä»ã®ã¡ã³ãã¼ãããæ稿äºå®ãããã¾ãã®ã§ãæå¾
ãã ããï¼