dyno ããã³ Dyno Manager
ãã®è¨äºã®è±èªçã«æ´æ°ãããã¾ããã覧ã®ç¿»è¨³ã«ã¯å«ã¾ãã¦ããªãå¤æ´ç¹ãããããããã¾ããã
æçµæ´æ°æ¥ 2024å¹´04æ25æ¥(æ¨)
Table of Contents
- dyno ã®è¨å®
- Dyno Manager
- dyno ã¿ã¤ã
- ã¹ã±ã¼ã©ããªãã£
- åé·æ§
- åé¢ã¨ã»ãã¥ãªãã£
- ãããã¯ã¼ãã³ã°
- dyno 管çç¨ CLI ã³ãã³ã
- dyno ã®ã¹ãªã¼ã
- èµ·å
- åèµ·å
- ã·ã£ãããã¦ã³
- dyno ã©ã¤ããµã¤ã¯ã«ã¬ã¤ãã³ã·ã¼
- ã¡ã¢ãªã®åä½
- å¤é¨ãµã¼ãã¹ã¸ã®æ¥ç¶
- dyno ããã³ãªã¯ã¨ã¹ã
Heroku ã¢ããªã±ã¼ã·ã§ã³ã¯ãã¹ã¦ãdynoâ ã¨å¼ã°ãã軽éã® Linux ã³ã³ããã®éã¾ãã«ããã¦å®è¡ããã¾ãããã®è¨äºã§ã¯ãHeroku ãã©ãããã©ã¼ã ã® dyno ã®è¦åã«ã¤ãã¦èª¬æãã¾ãã
dyno ã®ä¾¡æ ¼è¨å®ã®è©³ç´°ã«ã¤ãã¦ã¯ããHeroku ä¾¡æ ¼è¨å®ã®æ¦è¦âããåç §ãã¦ãã ããã
dyno ã®è¨å®
ãã¹ã¦ã® dyno ã¯ä»¥ä¸ã® 3 ã¤ã®è¨å®ã®ãã¡ããããã«å±ãã¦ãã¾ãã
Webâ: Web dyno ã¯ãProcfileâ ã§å®ç¾©ãããããWebãããã»ã¹ã¿ã¤ãã® dyno ã§ããã«ã¼ã¿ã¼âãã HTTP ãã©ãã£ãã¯ãåä¿¡ããã®ã¯ Web dyno ã ãã§ãã
Workerâ: Worker dyno ã¯ãProcfile ãã¡ã¤ã«ã§å®£è¨ããããWebã以å¤ã®ããããããã»ã¹ã¿ã¤ãã® dyno ã§ããWorker dyno ã¯é常ãããã¯ã°ã©ã¦ã³ãã¸ã§ãããã¥ã¼ã¤ã³ã°ã·ã¹ãã ãã¿ã¤ã ãã¸ã§ãã«ä½¿ç¨ããã¾ããã¢ããªã±ã¼ã·ã§ã³ã§è¤æ°ã®ç¨®é¡ã® Worker dyno ã使ããã¨ãã§ãã¾ãããã¨ãã°ã1 ã¤ãç·æ¥ã®ã¸ã§ãã«ããã 1 ã¤ãé·æå®è¡ã¸ã§ãã«ä½¿ç¨ãã¾ãã詳細ã«ã¤ãã¦ã¯ããWorker dynoãããã¯ã°ã©ã¦ã³ãã¸ã§ãããã³ãã¥ã¼ã¤ã³ã°âããåç §ãã¦ãã ããã
One-offâ: One-off dyno ã¯ãåç¬ã§ãã¾ãã¯å ¥å/åºåããã¼ã«ã«ã®ã¿ã¼ããã«ã«æ¥ç¶ãã¦å®è¡ã§ããä¸æç㪠dyno ã§ãããããã«ã¯ææ°ã®ãªãªã¼ã¹ããã¼ãããã¾ãããã¼ã¿ãã¼ã¹ç§»è¡ãã³ã³ã½ã¼ã«ã»ãã·ã§ã³ãªã©ã®ç®¡çã¿ã¹ã¯ã®å¦çã«ä½¿ç¨ã§ãã¾ããHeroku Schedulerâã¨åæ§ãä¸å®æã®ããã¯ã°ã©ã¦ã³ãå¦çã®å®è¡ã«ã使ç¨ã§ãã¾ãã詳細ã«ã¤ãã¦ã¯ããOne-off dynoâããåç §ãã¦ãã ããã
Web dyno ã¾ã㯠Worker dyno ãéå§ãããã¨ãã¢ããªã® Dyno formationâ (åããã»ã¹ã¿ã¤ãã®å®è¡ä¸ã® dyno ã®æ°) ãå¤ãããdyno ã©ã¤ããµã¤ã¯ã«ã«ä¾åãã¾ããDyno formation ã¯ãå¤æ´ããªãéããã®ã¾ã¾ä¿æããã¾ããä¸æ¹ãOne-off dyno ã¯çæéã®ã³ãã³ããå®è¡ãã¦ããçµäºããã®ã¿ã§ãDyno formation ã«ã¯å½±é¿ããªããã¨ãæ³å®ããã¦ãã¾ãã
Dyno Manager
Dyno Manager ã«ãããdyno ã¯èªåã§å®è¡ãç¶ç¶ãã¾ããã¤ã¾ããã¢ããªã¯é常èªåæä½ã§ã¡ã³ããã³ã¹ãä¸è¦ã§ããCommon Runtimeâ ã«ã¯ãå°åããã 1 ã¤ã® Dyno Manager ããããå°åã§å®è¡ããã¦ãããã¹ã¦ã®ããã³ãã«ã¤ã㦠dyno ã®ç®¡çãæ å½ãã¾ããPrivate Spaces Runtime ã«ã¯ãã¹ãã¼ã¹ãã¨ã«å°ç¨ã® Dyno Manager ãããã¾ãããã® Dyno Manager ã¯ããã®ã¹ãã¼ã¹å ã§å®è¡ããã¦ãã dyno ã®ã¿ç®¡çãã¾ãã
dyno ã¿ã¤ã
Heroku ã§ã¯å¤æ°ã®ç°ãªã dyno ã¿ã¤ããæä¾ãã¦ãããããããã«ä¸é£ã®ç¬èªã®ããããã£ã¨ããã©ã¼ãã³ã¹ç¹æ§ãåãã£ã¦ãã¾ããEco dynoãBasic dynoãStandard dynoãPerformance dynoâ ã¯ãCommon Runtime ã§ãã¹ã¦ã® Heroku ã¦ã¼ã¶ã¼ã«ãå©ç¨ããã ãã¾ããPrivate dyno 㯠Private Space ã§ã®ã¿å®è¡ãããHeroku Enterpriseâ ã§å©ç¨ã§ãã¾ãã
ã¹ã±ã¼ã©ããªãã£
æ°´å¹³æ¹åã¸ã®æ¡å¼µ (ã¹ã±ã¼ã«ã¢ã¦ã) ã®å ´åã¯ãdyno ã追å ãã¾ãããã¨ãã°ãdyno ã追å ããã¨ãããå¤ãã®ä¸¦å HTTP ãªã¯ã¨ã¹ããå¦çã§ããããããã大éã®ãã©ãã£ãã¯ãå¦çã§ãã¾ãã詳細ã«ã¤ãã¦ã¯ããDyno formation ã®ã¹ã±ã¼ãªã³ã°âããåç §ãã¦ãã ããã
åç´æ¹åã¸ã®æ¡å¼µ (ã¹ã±ã¼ã«ã¢ãã) ã®å ´åã¯ããã大ã㪠dyno ã使ç¨ãã¾ããã¢ããªã±ã¼ã·ã§ã³ã§ä½¿ç¨ã§ãã RAM ã®ä¸éã¯ã使ç¨ãã dyno ã¿ã¤ãã«ãã£ã¦ç°ãªãã¾ããCommon Runtime ã®è©³ç´°ã«ã¤ãã¦ã¯ãdyno ã¿ã¤ãâãããPrivate Space ã®è©³ç´°ã«ã¤ãã¦ã¯ãHeroku Enterpriseâããåç §ãã¦ãã ããã
æ°´å¹³æ¹åããã³åç´æ¹åã®æ¡å¼µã¯ãããã Professional dyno ã®æ©è½ã§ãããeco
â dyno ã¾ã㯠basic
â dyno ã§ã¯å©ç¨ã§ãã¾ããã
åé·æ§
è¤æ°ã® dyno ãå®è¡ä¸ã®ã¢ããªã±ã¼ã·ã§ã³ã¯ãé害ã«å¯¾ãã¦åé·æ§ãé«ããªãã¾ããdyno ãæ¬ è½ãã¦ããå ´åãã¢ããªã±ã¼ã·ã§ã³ã¯ãªã¯ã¨ã¹ãã®å¦çãç¶è¡ããæ¬ è½ãã¦ãã dyno ã¯ç½®ãæãããã¾ããé常ãæ¬ è½ãã¦ãã dyno ã¯ãã ã¡ã«åèµ·åããã¾ãããé大ãªé害ã®å ´åã¯æéãããããã¨ãããã¾ããè¤æ°ã® dyno ãç°ãªãç©çã¤ã³ãã©ã¹ãã©ã¯ã㣠(åå¥ã® AWS ã¢ãã¤ã©ããªãã£âã¾ã¼ã³ãªã©) ã§å®è¡ãããå¯è½æ§ãé«ããããã«åé·æ§ãå¢ãã¾ãã
åé¢ã¨ã»ãã¥ãªãã£
ã»ãã¥ãªãã£ä¸ã®çç±ããããã¹ã¦ã® dyno ã¯ããããå¼·åã«åé¢ããã¦ãã¾ããHeroku ã§ã¯è¿½å ã®ã«ã¹ã¿ã ãã¼ããã³ã°ã«ãã OS ã®ã³ã³ããåã使ç¨ãã¦ããã¹ã¦ã®ã客æ§ã«ã¤ãã¦ã¢ã¯ã»ã¹ãé©åã«å¶éãããããã«ãã¦ãã¾ãã
Eco dynoãBasic dynoãããã³ Standard dyno ã¯ãå®å ¨ã«åé¢ããã¦ããå ´åã§ããåºç¤ã¨ãªãã³ã³ãã¥ã¼ãã£ã³ã°ã¤ã³ã¹ã¿ã³ã¹ãå ±æãã¦ãããã¨ãããã¾ããHeroku ã§ã¯ãè¤æ°ã®ææ³ãæ¡ç¨ãã¦ãåºç¤ã¨ãªããªã½ã¼ã¹ãé©æ£ã«ä½¿ç¨ãããããã«ãã¦ãã¾ãããã ãããããã® dyno ã¿ã¤ãã§ã¯ãåºç¤ã¨ãªãã¤ã³ã¹ã¿ã³ã¹ã¸ã®è² è·åè¨ã«å¿ãã¦ããã©ã¼ãã³ã¹ã«ã°ãã¤ããåºãå¯è½æ§ãããã¾ãã
Performance dyno ããã³ Private dyno ã¯ãåºç¤ã¨ãªãã³ã³ãã¥ã¼ãã£ã³ã°ã¤ã³ã¹ã¿ã³ã¹ãä»ã® dyno ã¨å ±æãã¾ããããã®ããããããã® dyno ã¿ã¤ãã¯å¼·åãªã ãã§ã¯ãªããããã©ã¼ãã³ã¹ã®ã°ãã¤ããå°ãªããå®å®ãã¦ãã¾ããå°ç¨ã®ã³ã³ãã¥ã¼ãã£ã³ã°ãªã½ã¼ã¹ãåãã¦ããã®ã«å ããPrivate dyno ã¯ãããããããã¤ããã¦ãã Private Space ã«ãã£ã¦æ±ºå®ãããç¬èªã®ä»®æ³ãããã¯ã¼ã¯ã«ããã«åé¢ããã¦ãã¾ãã
ä¸æçãªãã¡ã¤ã«ã·ã¹ãã
å dyno ã«ã¯ãæãæè¿ãããã¤ãããã³ã¼ãã®æ°ããã³ãã¼ãå«ã¾ãããç¬èªã®ä¸æçãªãã¡ã¤ã«ã·ã¹ãã ãããã¾ããdyno ã®çåæéä¸ãå®è¡ä¸ã®ããã»ã¹ã§ãã®ãã¡ã¤ã«ã·ã¹ãã ãä¸æçãªã¹ã¯ã©ãããããã¨ãã¦ä½¿ç¨ã§ãã¾ãããæ¸ãè¾¼ã¾ãããã¡ã¤ã«ã¯ä»ã® dyno ã®ããã»ã¹ã§ã¯è¡¨ç¤ºããããæ¸ãè¾¼ã¾ãããã¹ã¦ã®ãã¡ã¤ã«ã¯ dyno ãåæ¢ã¾ãã¯åèµ·åããæç¹ã§ç ´æ£ããã¾ãããã®ç ´æ£ã¯ãã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ã«ãã£ã¦ dyno ãç½®ãæãããããã³ãããã³é常㮠dyno 管çã®ä¸ç°ã¨ãã¦ãããä¸æ¥ä¸åçºçãã¾ãã
ã·ã¹ãã ã¯ããã¯ããã³æéã®åæ
dyno ã¯ãã«ã¼ãã«ã®ãã¹ã¹ã«ã¼ããéæ¥çã« Network Time Protocol (NTP) ãæéã®åæã«ä½¿ç¨ãã¾ããdyno ã®åºç¤ã¨ãªããã¹ãã¯ãHeroku ãã©ãããã©ã¼ã ã® Stratum 2 NTP ãµã¼ãã¼ã«ãã£ã¦æä¾ãããã¿ã¤ã ãµã¼ãã¹ã使ç¨ããããã«è¨å®ããã¦ãã¾ãããããã®ãµã¼ãã¼ã¯ãNISTâ ã«ãã£ã¦æä¾ããã Stratum 1 ã¿ã¤ã ãµã¼ãã¼ã®ãã¼ã«ã«é çªã«åæããã¾ããHerokuã§ã¯ãåãã¿ã¤ã ãµã¼ãã¼ãããªã¼ãå ¨ä½ã§ä½¿ç¨ãããå ´æã«é¢ä¿ãªãæéãåä¸ã§åæãããããã«ãªã£ã¦ãã¾ãã
ãããã¯ã¼ãã³ã°
å dyno ã«ã¯ç¬èªã®ãããã¯ã¼ã¯ã¤ã³ã¿ã¼ãã§ã¼ã¹ãããã¾ããå¨è¾ºã®ãããã¯ã¼ã¯è¨å®ã¯ã©ã³ã¿ã¤ã âã®ã¿ã¤ãã«ãã£ã¦ç°ãªãã¾ãã
Common Runtime ã®ãããã¯ã¼ãã³ã°
Common Runtime ã§ã¯ããã¡ã¤ã¢ã¦ã©ã¼ã«ãè¨å®ãããã¨ã«ãã£ã¦ããã¹ã¦ã® dyno ãç¸äºã«å¼·åã«åé¢ããã¾ããdyno ã«å°éã§ããå¯ä¸ã®ãã©ãã£ãã¯ã¯ã$PORT
â ç°å¢å¤æ°ã§æå®ããããã¼ãçªå·ããªãã¹ã³ãã Web ããã»ã¹ã«ã«ã¼ã¿ã¼ãã転éããã Web ãªã¯ã¨ã¹ãã§ããWorker dyno ããã³ One-off dyno ã¯ã¤ã³ãã¦ã³ããªã¯ã¨ã¹ããåä¿¡ãããã¨ãã§ãã¾ããã
dyno å ã®åã ã®ããã»ã¹ã¯ä»»æã®ã¢ãã¬ã¹ããã¼ãã«ãã¤ã³ãããããã¤ã³ããããããã»ã¹éã§æ¨æº TCP ãªã©ã使ç¨ãã¦éä¿¡ãããã¨ãã§ãã¾ããå dyno ã®å¤é¨ãããã¯ã¼ã¯ã¤ã³ã¿ã¼ãã§ã¼ã¹ (eth0) ã¯ãç¯å²ã 172.16.0.0/12 ã® /30 ãã©ã¤ãã¼ããµãããã (172.16.83.252/30 ã172.30.239.96/30 ãªã©) ã®ä¸é¨ã¨ãªãã¾ãã1 ã¤ã® dyno å ã®ããã»ã¹ã¯ãIP ã¾ãã¯ãµãããããä»ã® dyno ã¨å ±æãããã¨ããä»ã® dyno ã® TCP ã»ãã·ã§ã³ã®ç¶æ ãç£è¦ãããã¨ãããã¾ããã
Common Runtime ã®ãã¹ã¦ã® dyno ã¿ã¤ãã¯ãã¤ã³ã¿ã¼ãããä¸ã®ä»ã®å ´æã§å®è¡ããã¦ãããµã¼ãã¹ã«ã¢ã¦ããã¦ã³ããªã¯ã¨ã¹ããè¡ããã¨ãã§ãã¾ããã¦ã¼ã¶ã¼ã¯ããããã®ãªã¯ã¨ã¹ãã®çºä¿¡å ã¨ãªã IP ã¢ãã¬ã¹ãå¶å¾¡ã§ãã¾ããã
Private Spaces Runtime ãããã¯ã¼ãã³ã°
Private Space å
ã® dyno ã¯ãã¹ã¦ããã®ã¹ãã¼ã¹ã®ä¸é¨ã¨ãã¦è¨å®ããã¦ããä»®æ³ãã©ã¤ãã¼ããããã¯ã¼ã¯ãéãã¦æ¥ç¶ããã¦ãã¾ããã¹ãã¼ã¹ã«ã¤ã³ã¹ãã¼ã«ããã¦ãããã¹ã¦ã®ãã¼ã¿ãµã¼ãã¹ãããã®ãããã¯ã¼ã¯ã«æ¥ç¶ããã¦ãã¾ããCommon Runtime ã¨åæ§ãWeb ããã»ã¹ã¯ $PORT
â ç°å¢å¤æ°ã§æå®ããã¦ãããã¼ãçªå·ããªãã¹ã³ãããã¨ã«ãã£ã¦ Web ãªã¯ã¨ã¹ããåä¿¡ã§ãã¾ããããã«ãdyno å
ã®ãã¹ã¦ã®ããã»ã¹ã¯ä»»æã®ãã¼ãçªå·ããªãã¹ã³ãããã©ã¤ãã¼ããããã¯ã¼ã¯ä¸ã®ä»ã® dyno ããæ¥ç¶ãåä¿¡ãããã¨ãã§ãã¾ããããã¯ãWeb ããã»ã¹ãWorker ããã»ã¹ãOne-off ããã»ã¹ã§ãµãã¼ãããã¾ãã
ä¿¡é ¼æ¸ã¿ IP ç¯å²âã¯ãPrivate Space å ã®ã¢ããªã±ã¼ã·ã§ã³ã¨éä¿¡ã§ããã¯ã©ã¤ã¢ã³ã IP ãå¶å¾¡ããããã«ä½¿ç¨ã§ãã¾ãã
Private Space å ã® dyno ã¯ããã¹ã¦ã®æ¥ç¶ãä¸é£ã®åºå®ã®ã¢ã¦ããã¦ã³ã IP ã¢ãã¬ã¹âããçºä¿¡ãããããã«ãã NAT ã²ã¼ãã¦ã§ã¤çµç±ã§ãä»ã®ã¤ã³ã¿ã¼ããããµã¼ãã¹ã¸ã®ã¢ã¦ããã¦ã³ãæ¥ç¶ãè¡ãã¾ãã
dyno 管çç¨ CLI ã³ãã³ã
ã¢ããªã® dyno è¨å®ã表示ããã³å¤æ´ããã«ã¯ãHeroku CLI ã使ç¨ãã¾ãã
ã¿ã¹ã¯ | ä¾ | é¢é£æ å ± |
---|---|---|
ã¢ããªã«å¯¾ãã dyno ã®ä¸è¦§è¡¨ç¤º | heroku ps â |
ã¹ã±ã¼ãªã³ã° |
Worker dyno ãèµ·åãã¾ã(ã¢ããªã«å¯¾ãã¦å®ç¾©ããã¦ãã Worker ããã»ã¹ã¿ã¤ã㯠Procfile ã§ç¢ºèªãã¦ãã ãã)ã | heroku ps:scale worker=2 â |
ã¹ã±ã¼ãªã³ã° |
ç¹å®ã® dyno ã¿ã¤ãã®åæ¢ * | heroku ps:stop worker â |
ã¹ã±ã¼ãªã³ã° |
ç¹å®ã® dyno ã®åæ¢ * | heroku ps:stop worker.2 â |
ã¹ã±ã¼ãªã³ã° |
ãã¹ã¦ã® dyno ã®åèµ·å | heroku ps:restart â |
Dyno Manager |
ç¹å®ã® dyno ã¿ã¤ãã®åèµ·å | heroku ps:restart web â |
Dyno Manager |
ç¹å®ã® dyno ã®åèµ·å | heroku ps:restart web.1 â |
Dyno Manager |
æ°´å¹³æ¹åã¸ã®æ¡å¼µ (dyno ã®è¿½å ) | heroku ps:scale web=2 â |
ã¹ã±ã¼ãªã³ã° |
ç¾å¨ã® dyno ã®æ°ãå¢ãããã¨ã«ããæ°´å¹³æ¹åã¸ã®æ¡å¼µ | heroku ps:scale web+5 â |
ã¹ã±ã¼ãªã³ã° |
ç°ãªã dyno ã¿ã¤ãã®æ°´å¹³æ¹åã®åææ¡å¼µ | heroku ps:scale web=1 worker=5 â |
ã¹ã±ã¼ãªã³ã° |
åç´æ¹åã¸ã®æ¡å¼µ (ãã大ã㪠dyno ã®ä½¿ç¨) | heroku ps:resize worker=standard-2x â |
dyno ã¿ã¤ã |
æ°´å¹³æ¹åã¨åç´æ¹åã¸ã®åææ¡å¼µããã®ä¾ã§ã¯ãWeb dyno ã®æ°ã3 ã¤ã«æ¡å¼µããperformance-l ã«ãµã¤ãºå¤æ´ãã¾ã | heroku ps:scale web=3:performance-l â |
dyno ã¿ã¤ã |
heroku ps ã³ãã³ãã®ãã«ãã®åå¾ | heroku ps --help â |
|
ã³ã³ã½ã¼ã«ã§ bash ãå®è¡ãã One-off dyno ã®èµ·å | heroku run bash â |
One-off dyno |
ã¢ããªã±ã¼ã·ã§ã³ã® Procfile ã«ãããWorkerãããã»ã¹ã¿ã¤ããå®è¡ãã One-off dyno ã®èµ·å | heroku run worker â |
One-off dyno |
ãã°ã®è¡¨ç¤º | heroku logs â ã¾ã㯠heroku logs --tail â |
ãã°è¨é² |
*â æ¡å¼µãããããã»ã¹ã®ä¸é¨ã§ãã dyno 㧠ps:stop
â ãå®è¡ããã¨ãdyno ãèªåçã«åèµ·åããã¾ããPrivate Space ã§ã¯ãdyno ãå®è¡ãã¦ããå°ç¨ã¤ã³ã¹ã¿ã³ã¹ã ps:stop
â ã«ãã£ã¦çµäºããç½®ãæãããã¾ããdyno ãæ°¸ç¶çã«åæ¢ããã«ã¯ãããã»ã¹ãã¹ã±ã¼ã«ãã¦ã³ãã¾ãã
ã¢ããªã®ä¸é¨ã® dyno ã®è¨å®ããHeroku Dashboardâ ã§å¤æ´ãããã¨ãã§ãã¾ãã
dyno ã®ã¹ãªã¼ã
ã¹ãªã¼ãã§ããã®ã¯ eco
â dyno ã®ã¿ã§ãã詳細ã¯ããEco Dyno Hoursâã(Eco dyno æé) ãåç
§ãã¦ãã ããã
èµ·å
.profile
ãã¡ã¤ã«
èµ·åä¸ãã³ã³ããã«ãã£ã¦ãdyno ã³ãã³ãã®å®è¡åã«ã$HOME/.profile
â ã®ããããã³ã¼ããå®è¡ãã bash
â ã·ã§ã«ãéå§ããã¾ãããã®ãã¡ã¤ã«ã« bash
â ã³ã¼ããå
¥åãã¦ãã¢ããªå
ã®ãããã dyno ã¿ã¤ãã®ã©ã³ã¿ã¤ã ã®åæç°å¢ãå¶å¾¡ãã¾ãã
.profile
â ã¹ã¯ãªããã¯ãã¢ããªã®ç°å¢è¨å®ã®å¾ã«â調éããã¾ããç°å¢è¨å®ãåªå
ãããããã«ããã«ã¯ã以ä¸ã§ LANG
â ã§è¡ããã¦ããã®ã¨åæ§ã®ãã¯ããã¯ã使ç¨ãã¾ãã
# add vendor binaries to the path
export PATH=$PATH:$HOME/vendor/bin
# set a default LANG if it does not exist in the environment
export LANG=${LANG:-en_US.UTF-8}
ã»ã¼ãã¹ã¦ã®ç®çã«ã¤ãã¦ãç°å¢è¨å®â㯠.profile ããã便å©ã§æè»æ§ãããã¾ããç°å¢è¨å®ãç·¨éããããã«æ°ããã³ã¼ããå
¥åããå¿
è¦ã¯ããã¾ãããã.profile
â ã¯ã½ã¼ã¹ããªã¼ã®ä¸é¨ã§ããããã¹ã¦ã®ã³ã¼ãå¤æ´ã¨åæ§ã«ç·¨éããã³ãããã¤ããå¿
è¦ãããã¾ãã
ãã¼ã«ã«ç°å¢å¤æ°
Dyno Manager ã«ãããã¢ããªã±ã¼ã·ã§ã³å ã§ã¢ã¯ã»ã¹ã§ããå¤æ°ã®ããã©ã«ãç°å¢å¤æ°ãè¨å®ããã¾ãã
- dyno ã Web dyno ã§ããå ´åã¯ã
$PORT
â å¤æ°ãè¨å®ããã¾ããdyno ãåä¿¡ãªã¯ã¨ã¹ããåãåãã«ã¯ããã®ãã¼ãçªå·ã«ãã¤ã³ãããå¿ è¦ãããã¾ãã
$DYNO
â å¤æ°å¤ãã¢ããªå
ã§ä¸æã§ããä¿è¨¼ã¯ããã¾ããããã¨ãã°ããããã¤ä¸ã¾ãã¯åèµ·åä¸ã«ã2 ã¤ã®å®è¡ä¸ã® dyno ã«åã dyno ID ã使ç¨ããããã¨ãããã¾ãããã ããæçµçã«ã¯æ´åãåãã¾ãã
$DYNO
â å¤æ°ã¯ãweb.1
âãworker.2
âãrun.9157
â ãªã©ã® dyno ID ã«è¨å®ããã¾ãã
ããã»ã¹
.profile
â ã¹ã¯ãªãããå®è¡ãããå¾ãdyno ã«ãã£ã¦ãdyno ã®ããã»ã¹ã¿ã¤ãâã«é¢é£ä»ãããã¦ããã³ãã³ããå®è¡ããã¾ãããã¨ãã°ãdyno ã Web dyno ã®å ´åã¯ãWeb ããã»ã¹ã¿ã¤ãã«é¢é£ä»ãããã¦ãã Procfile ã®ã³ãã³ããå®è¡ããã¾ãã
å®è¡ãããã³ãã³ãã«ããã追å ã®ããã»ã¹ãçºçããå¯è½æ§ãããã¾ãã
dyno å ã®å¤ç«ããã»ã¹âã¯ãã¾ã³ã/ä¼ç ããã»ã¹ãé¿ãããããå®æçã«é¤å»âããå¿ è¦ãããã¾ãã
ããã»ã¹/ã¹ã¬ããå¶é
åæã« 1 ã¤ã® dyno å ã«åå¨ã§ããããã»ã¹/ã¹ã¬ããã®æ大æ°ã¯ãdyno ã¿ã¤ãâã«å¿ãã¦ç°ãªãã¾ãã
eco
â dynoãbasic
â dynoãããã³standard-1x
â dyno ã®å ´åãæ大æ°ã¯ 256 以ä¸ã§ããstandard-2x
â dyno ããã³private-s
â dyno ã®å ´åãæ大æ°ã¯ 512 以ä¸ã§ããperformance-m
âãprivate-m
âãshield-m
â dyno ã®å ´åãæ大æ°ã¯ 16384 以ä¸ã§ããperformance-l
âãprivate-l
âãshield-l
â dyno ã®å ´åãæ大æ°ã¯ 32768 以ä¸ã§ããperformance-l-ram
âãprivate-l-ram
âãshield-l-ram
â dyno ã®å ´åãæ大æ°ã¯ 24576 以ä¸ã§ããperformance-xl
âãprivate-xl
âãshield-xl
â dyno ã®å ´åãæ大æ°ã¯ 32768 以ä¸ã§ããperformance-2xl
âãprivate-2xl
âãshield-2xl
â dyno ã®å ´åãæ大æ°ã¯ 65536 以ä¸ã§ãã
ãããã®ä¸éã«ã¯ãå®è¡ä¸ãä¼æ¢ä¸ãã¾ãã¯ãã®ä»ã®ç¶æ
ã®ãã¹ã¦ã®ããã»ã¹ã¨ã¹ã¬ãããå«ã¾ãã¾ããã¹ã¬ããã¨ããã»ã¹ã¯ãã®ä¸éã«å¯¾ãã¦ã«ã¦ã³ãããããã¨ã«æ³¨æãã¦ãã ããããã¨ãã°ã255 ã®ã¹ã¬ãã㨠1 ã¤ã®ããã»ã¹ãå«ã¾ãã standard-1x
â dyno ã¯ãå¶éã 256 以ä¸ã§ãããããä¸éã«å°éãã¦ãã¾ãã
Web dyno
Web dyno ã¯ãèµ·åãã 60 ç§ä»¥å
ã«ãå²ãå½ã¦ããã $PORT
â ã«ãã¤ã³ãããå¿
è¦ãããã¾ãããã¤ã³ãããªãå ´åãWeb dyno 㯠Dyno Manager ã«ãã£ã¦å¼·å¶çµäºãããR10 (ãã¼ãã¿ã¤ã ã¢ã¦ã)â ã¨ã©ã¼ããã°ã«è¨é²ããã¾ããããã»ã¹ã¯ã$PORT
â ã«ãã¤ã³ãããåã¨ãã¤ã³ãããå¾ãä»ã®ãã¼ãã«ãã¤ã³ãã§ãã¾ãã
ã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ãã«ããã«å¤ãã®æéãå¿ è¦ãªå ´åããã¼ãã¿ã¤ã ã¢ã¦ããã¼ã«âã使ç¨ãã¦ä¸éãå¢ãããã¨ãã§ãã¾ãããã ããä¸è¬çã«èµ·åæéãé ãã¨ã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ãå°é£ã«ãªããdyno ã®ã¨ã©ã¼ããã®ãªã«ããªã«ãæéãããããããããã¯ä¸æçãªè§£æ±ºçâã¨ãã¦ãã ããã
åèµ·å
dyno ã®èªååèµ·å
Dyno Manager ã«ããã以ä¸ã®å ´åã«ã¢ããªã® dyno ããã¹ã¦åèµ·åããã¾ãã
- æ°ããã³ã¼ãã®ãããã¤ã«ããæ°ãããªãªã¼ã¹âã®ä½ææ
- ç°å¢è¨å®âã®å¤æ´æ
- ã¢ããªã³âã®å¤æ´æ
heroku restart
â ã®å®è¡æ
ã¾ããHeroku ã§å®è¡ããã¦ããã¢ããªã±ã¼ã·ã§ã³ã®ãã«ã¹ãç¶æããããã«ãdyno ã¯æä½ä¸æ¥ä¸åã¯åèµ·åããã¾ãããã¼ã«ã«ãã¡ã¤ã«ã·ã¹ãã ã¸ã®å¤æ´ã¯ãã¹ã¦åé¤ããã¾ãâãåèµ·å㯠24 æéãã¨ã«è¡ããã¾ã (åä¸ã¢ããªã±ã¼ã·ã§ã³ã®ãã¹ã¦ã® dyno ãåæã«åèµ·åããã®ãé¿ããããã追å ã§æ大 216 åã®ã©ã³ãã ãªééã§ãè¡ããã¾ã)ãæåã§ã®åèµ·å (heroku ps:restart
â) ããã³ãªãªã¼ã¹ (ãããã¤ã¾ãã¯ç°å¢è¨å®ã®å¤æ´) ã¯ããã® 24 æéã®å¨æã§ãªã»ããããã¾ããåèµ·å㯠One-off dyno ãå«ããã¹ã¦ã® dyno ã§è¡ããããããdyno ã¯æ大㧠24 æé + 216 åéå®è¡ããã¾ããè¤æ°ã® xyno ãããå ´åã0 ãã 216 åã®éã§ã©ã³ãã ã«ãç°ãªãã¿ã¤ãã³ã°ã§åèµ·åããå¿
è¦ãããã¾ãã24 æéçµéããåã«ã¢ããªã±ã¼ã·ã§ã³ã«å¤æ´ãè¡ãã¨ãåèµ·åã¯è¡ããã¾ãããdyno ãåèµ·åãããã¨ã以ä¸ã®ãããªãã°ã¨ã³ããªã表示ããã¾ãã
2015-08-18T06:20:13+00:00 heroku[web.1]: Cycling
ããã«ãã·ã¹ãã ããã³ã¢ããªã®å ¨ä½çãªãã«ã¹ã«å¿ è¦ã«ãªã£ãã¿ã¤ãã³ã°ã§ããdyno ã¯åèµ·åããã¾ãããã¨ãã°ãDyno Manager ãåºç¤ã¨ãªããã¼ãã¦ã§ã¢ã®é害ãæ¤åºããdyno ãç©ççã«æ°ããå ´æã«ç§»åããå¿ è¦ãçãããã¨ãããã¾ãããã®ãããªå¦çã¯å®æçã«ééçãã¤èªåã§è¡ãããã¢ããªã±ã¼ã·ã§ã³ãã°âã«è¨é²ããã¾ãã
dyno ã¯ãdyno ã®èµ·åã«ä½¿ç¨ãããã³ãã³ããçµäºããå ´åã«ãåèµ·åããã¾ããdyno ã®èµ·åã«ä½¿ç¨ãããã³ãã³ããçµäºããã±ã¼ã¹ã«ã¯ã以ä¸ã®ãããªãã®ãããã¾ãã
- èµ·åã³ã¼ãã®æ¬ é¥ - ã¢ããªã«ä¸å¯æ¬ ã®ä¾åé¢ä¿ããªãå ´åãã¾ãã¯èµ·åæã®ãã®ä»ã®åé¡ãããå ´åã¯ãã³ãã³ãããã ã¡ã«çµäºããã¹ã¿ãã¯ãã¬ã¼ã¹ãåºåããã¾ãã
- èµ·åæã«ä½¿ç¨ããããªã½ã¼ã¹ã§ã®ä¸æçãªã¨ã©ã¼ - èµ·åæã«ã¢ããªãä½ããã®ãªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ãããã®ãªã½ã¼ã¹ããªãã©ã¤ã³ã®å ´åãã³ãã³ããçµäºãããã¨ãããã¾ãããã¨ãã°ããã¼ã¿ãã¼ã¹ã¨ã㦠Amazon RDS ã使ç¨ããHeroku ã¢ããªã«ã»ãã¥ãªãã£ã°ã«ã¼ãã® ingress ãä½æããªãå ´åãã¨ã©ã¼ãçæãããããèµ·åã®è©¦è¡ãã¿ã¤ã ã¢ã¦ãã«ãªãã¾ãã
- ãã¤ããªã©ã¤ãã©ãªã®ã»ã°ã¡ã³ãã¼ã·ã§ã³éå - ã¢ããªã§ãã¤ããªã©ã¤ãã©ãª (ä¾: XML parser) ã使ç¨ããããã®ã©ã¤ãã©ãªãã¯ã©ãã·ã¥ããå ´åãã¢ããªã±ã¼ã·ã§ã³å ¨ä½ãã¯ã©ãã·ã¥ããå¯è½æ§ãããã¾ããä¾å¤å¦çã¯ãããææã§ããªããããããã»ã¹ãåæ¢ãã¾ãã
- ã¤ã³ã¿ã¼ããªã¿ã¼ã¾ãã¯ã³ã³ãã¤ã©ã¼ã®ãã° - ã¾ããªã±ã¼ã¹ã¨ãã¦ãã¤ã³ã¿ã¼ããªã¿ã¼ (RubyãPython) ã¾ãã¯ã³ã³ãã¤ã« (JavaãScala) ã®ãã°ã«ãã£ã¦ããã»ã¹ãåæ¢ãããã¨ãããã¾ãã
dyno ã®ã¯ã©ãã·ã¥åèµ·åããªã·ã¼
dyno ã®ãã¯ã©ãã·ã¥ãã¨ã¯ãdyno ã§å®è¡ä¸ã®ããã»ã¹ããçºçããdyno ãåæ¢ããåå ã¨ãªããã¹ã¦ã®ã¤ãã³ããæãã¾ããããã«ã¯ã0
â ã®çµäºã³ã¼ã (ã¾ãã¯ãã®ä»ã®ããããçµäºã³ã¼ã) ã§çµäºããããã»ã¹ãå«ã¾ãã¾ãã
Common Runtime ã«ãããã¯ã©ãã·ã¥ãã dyno ã«ã¤ãã¦ã®å¢åããã¯ãªãããªã·ã¼ãå®è£ ããã¾ãã
- dyno ãåãã¦ã¯ã©ãã·ã¥ããå ´åããã ã¡ã«åèµ·åããã¾ãã
- dyno ãåã³ã¯ã©ãã·ã¥ããã¨ãåèµ·åã試è¡ãããåã«ãã¯ã¼ã«ãªãã®æéããããããã¾ãã
- æåã®ã¯ã¼ã«ãªãæéã¯æ大 20 åã次ã¯æ大 40 åããã®å¾ã¯æ大 60 åãæ大 180 åã¨ãªããæçµçã«æ大 320 åã¨ãªãã¾ãã
- 320 åã®ã¯ã¼ã«ãªãæéã«å°éããã¨ãåèµ·å㯠320 åããã«è©¦è¡ããã¾ãã
- ã¯ã¼ã«ãªãæéã¯ãdyno ãæ£å¸¸ã«èµ·åããããã¢ããªã«æ°ãããªãªã¼ã¹ãããã·ã¥ãããã(
heroku restart
â ã¨å ¥åãã¦) ã¢ããªãåèµ·åããããã¾ã㯠dyno ã 0 ã«ã¹ã±ã¼ã«ãã¦ã³ãã¦ããåã³ã¹ã±ã¼ã«ã¢ããããã¨ãªã»ããããã¾ãã
Private Spaces Runtime ã«ã¯ããã¯ãªãããªã·ã¼ãããã¾ãããdyno ãã¯ã©ãã·ã¥ããå ´åãã¯ã¼ã«ãªãæéã¯ãªããç¹°ãè¿ãåèµ·åããã¾ãã
ã·ã£ãããã¦ã³
SIGTERM ã«ããã°ã¬ã¼ã¹ãã«ã·ã£ãããã¦ã³
Dyno Manager ã«ãã£ã¦ dyno ãåèµ·åãããã¨ãDyno Manager 㯠SIGTERM
â ã·ã°ãã«ãéä¿¡ãã¦ããã»ã¹ãç·©ããã«ã·ã£ãããã¦ã³ããããã«ãªã¯ã¨ã¹ããã¾ãããã®ã·ã°ãã«ã¯ãããã»ã¹ã¿ã¤ãã ãã§ã¯ãªããdyno ã®ãã¹ã¦ã®ããã»ã¹ã«éä¿¡ããã¾ãã
ç¾å¨ãã·ã£ãããã¦ã³ä¸ã® dyno ã®ããã»ã¹ãè¤æ°ã® SIGTERM ãåä¿¡ããå¯è½æ§ããããã¨ã«æ³¨æãã¦ãã ããã
ã¢ããªã±ã¼ã·ã§ã³ããã»ã¹ãã¯ãªã¼ã³ã«ã·ã£ãããã¦ã³ããã«ã¯ 30 ç§ãããã¾ã (ãã£ã¨ãã°ããã·ã£ãããã¦ã³ããã®ãçæ³ã§ã)ãã·ã£ãããã¦ã³ä¸ã¯ãæ°ãããªã¯ã¨ã¹ããã¸ã§ãã¯åãå
¥ãããããç¾å¨ã®ãªã¯ã¨ã¹ãã®çµäºã試è¡ãããããä»ã® Worker ããã»ã¹ãå¦çããããã«ã¸ã§ãããã¥ã¼ã«æ»ãããããã¾ãããã®æéãçµéããå¾ãããã»ã¹ãæ®ã£ã¦ããå ´åãDyno Manager 㯠SIGKILL
â ã§å¼·å¶çã«ãããã®ããã»ã¹ãçµäºãã¾ãã
å¶å¾¡ãããåèµ·åã¾ãã¯å®æçãªåèµ·åã®å®è¡ä¸ãã·ã£ãããã¦ã³ã·ã°ãã«ãå¤ã dyno ã®ããã»ã¹ã«éä¿¡ãããã¨ããã«ãæ°ãã dyno ãã¹ãã³ã¢ããããã¾ãã
ãããã©ã®ããã«æ©è½ããããããµã³ãã« Worker ããã»ã¹ã使ç¨ãã¦ãç·´ç¿ã§ç¢ºèªã§ãã¾ããããã§ã¯ã説æç¨ã®è¨èªã¨ã㦠Ruby ã使ç¨ãã¾ããã¡ã«ããºã ã¯ãã®ä»ã®è¨èªã¨åãã§ããã«ã¼ããçµããããå®æçã«ã¡ãã»ã¼ã¸ãåºåãããããã»ã¹ãæ³åãã¦ã¿ã¦ãã ããã
STDOUT.sync = true
puts "Starting up"
trap('TERM') do
puts "Graceful shutdown"
exit
end
loop do
puts "Pretending to do work"
sleep 3
end
ãã (é©å㪠Gemfile
â ããã³ Procfile
â ã¨ã¨ãã«)â) 㨠heroku ps:scale worker=1
â ããããã¤ããã¨ãdyno worker.1
â ã§å®è¡ä¸ã®ã«ã¼ãã§ããã»ã¹ã確èªã§ãã¾ãã
$ heroku logs
2011-05-31T23:31:16+00:00 heroku[worker.1]: Starting process with command: `bundle exec ruby worker.rb`
2011-05-31T23:31:17+00:00 heroku[worker.1]: State changed from starting to up
2011-05-31T23:31:17+00:00 app[worker.1]: Starting up
2011-05-31T23:31:17+00:00 app[worker.1]: Pretending to do work
2011-05-31T23:31:20+00:00 app[worker.1]: Pretending to do work
2011-05-31T23:31:23+00:00 app[worker.1]: Pretending to do work
dyno ãåèµ·åããã¨ãdyno ã SIGTERM
â ãåãã¨ãã¾ãã
$ heroku restart worker.1
Restarting worker.1 process... done
$ heroku logs
2011-05-31T23:31:26+00:00 app[worker.1]: Pretending to do work
2011-05-31T23:31:28+00:00 heroku[worker.1]: State changed from up to starting
2011-05-31T23:31:29+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2011-05-31T23:31:29+00:00 app[worker.1]: Graceful shutdown
2011-05-31T23:31:29+00:00 heroku[worker.1]: Process exited
(ã³ã¼ãããåããã¨ãã) app[worker.1]
â ããã°ã¬ã¼ã¹ãã«ã·ã£ãããã¦ã³ãããã°è¨é²ãã¾ãããã¹ã¦ã® Dyno Manager ã¡ãã»ã¼ã¸ã¯ heroku[worker.1]
â ã¨ãã¦ãã°è¨é²ãã¾ãã
以ä¸ã®ããã«ãTERM
â ã·ã°ãã«ãç¡è¦ããããã« worker.rb
â ãå¤æ´ããå ´å:
STDOUT.sync = true
puts "Starting up"
trap('TERM') do
puts "Ignoring TERM signal - not a good idea"
end
loop do
puts "Pretending to do work"
sleep 3
end
åä½ãå¤æ´ããã¦ããã®ãåããã¾ãã
$ heroku restart worker.1
Restarting worker.1 process... done
$ heroku logs
2011-05-31T23:40:57+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2011-05-31T23:40:57+00:00 app[worker.1]: Ignoring TERM signal - not a good idea
2011-05-31T23:40:58+00:00 app[worker.1]: Pretending to do work
2011-05-31T23:41:01+00:00 app[worker.1]: Pretending to do work
...
2011-05-31T23:41:25+00:00 app[worker.1]: Pretending to do work
2011-05-31T23:41:27+00:00 heroku[worker.1]: Error R12 (Exit timeout) -> Process failed to exit within 30 seconds of SIGTERM
2011-05-31T23:41:27+00:00 heroku[worker.1]: Stopping all processes with SIGKILL
2011-05-31T23:41:28+00:00 heroku[worker.1]: Process exited
ããã»ã¹ã«ãã£ã¦ SIGTERM
â ãç¡è¦ãããç¶æ³ãææ¡ããªãã¾ã¾å¦çãç¶è¡ããã¾ãã30 ç§å¾ãDyno Manager ã¯ããã»ã¹ãç·©ããã«ã·ã£ãããã¦ã³ããã¾ã§å¾
æ©ããã®ããããããSIGKILL
â ã§å¼·å¶çµäºãã¾ããError R12â ããã°ã«è¨é²ããã¾ãããããã¯ããã»ã¹ãé©åã«æä½ãã¦ããªããã¨ã示ãã¦ãã¾ãã
dyno ã©ã¤ããµã¤ã¯ã«ã¬ã¤ãã³ã·ã¼
Common Runtime å ã® dyno ã¯ãå¶å¾¡å¿çæ§ãæé©åããã¦ãã¾ããOne-off dyno ããã»ã¹ã®èµ·åã¾ã㯠Web ããã»ã¹ã Worker ããã»ã¹ã®ã¹ã±ã¼ã«ã¢ããã«ãããæéã¯æ°ç§ã§ãã
Private Space ã® dyno ã¯ãå ç¢æ§ã¨ããã©ã¼ãã³ã¹ãæé©åããã¦ãã¾ããOne-off dyno ã®èµ·åã¾ãã¯æ¢åã® Web formation ã Worker formation ã¸ã® dyno ã®è¿½å ã«ã¯æ°åããããã¨ãããã¾ãã
ã¡ã¢ãªã®åä½
ã¢ããªã±ã¼ã·ã§ã³ã§ä½¿ç¨ã§ãã RAM ã®ä¸éã¯ã使ç¨ãã dyno ã¿ã¤ãâã«ãã£ã¦ç°ãªãã¾ããDyno Manager ã«ãã£ã¦ dyno ãèµ·åãããã¡ã¢ãªä½¿ç¨çã以ä¸ã®å ´å㯠R15 ã¨ã©ã¼âããã°è¨é²ããã¾ãã
eco
âãbasic
âãã¾ãã¯standard-1x
â dyno ãå²ãå½ã¦ã® 2 åã«ããã 1 GB ã«å°éããå ´åãstandard-2x
â dyno ãå²ãå½ã¦ã® 2 åã«ããã 2 GB ã«å°éããå ´åãperformance-m
â dyno ãå²ãå½ã¦ã® 2 åã«ããã 5 GB ã«å°éããå ´åãperformance-l
â dyno ãå²ãå½ã¦ã® 2 åã«ããã 28 GB ã«å°éããå ´åãperformance-l-ram
â dyno ãå²ãå½ã¦ã® 1.2 åã«ããã 36 GB ã«å°éããå ´åãperformance-xl
â dyno ãå²ãå½ã¦ã® 1.2 åã«ããã 74 GB ã«å°éããå ´åãperformance-2xl
â dyno ãå²ãå½ã¦ã® 1.2 åã«ããã 151 GB ã«å°éããå ´åãprivate-s
â ã¾ãã¯shield-s
â dyno ãå²ãå½ã¦ã® 1 GB ã«å°éããå ´åãprivate-m
â ã¾ãã¯shield-m
â dyno ãå²ãå½ã¦ã® 2.5 GB ã«å°éããå ´åãprivate-l
â ã¾ãã¯shield-l
â dyno ãå²ãå½ã¦ã® 14 GB ã«å°éããå ´åãprivate-l-ram
â ã¾ãã¯shield-l-ram
â dyno ãå²ãå½ã¦ã® 30 GB ã«å°éããå ´åãprivate-xl
â ã¾ãã¯shield-xl
â dyno ãå²ãå½ã¦ã® 62 GB ã«å°éããå ´åãprivate-2xl
â ã¾ãã¯shield-2xl
â dyno ãå²ãå½ã¦ã® 126 GB ã«å°éããå ´åã
使ç¨ãã dyno ã¿ã¤ããå°ããããã¨ãã¡ã¢ãªã¹ã¯ãããç¹°ãè¿ãããã¢ããªã±ã¼ã·ã§ã³ã®ããã©ã¼ãã³ã¹ä½ä¸ã«ã¤ãªããã¾ããã¡ã¢ãªä½¿ç¨çãªã©ã®ã¢ããªã±ã¼ã·ã§ã³é¢é£ã®ææ¨âãã¼ã¿ã¯ãHeroku Dashboard ã®Metrics
â (ææ¨) ã¿ãã«ããã¾ãããã°ã®ã©ã³ã¿ã¤ã é¢é£ã®ææ¨ã§ã¡ã¢ãªã測å®âãããã¨ãã§ãã¾ããã¡ã¢ãªä½¿ç¨çã®åé¡ã¯ãã¢ããªã®ã¡ã¢ãªãªã¼ã¯ãåå ã¨ãªãå ´åãããã¾ããã¡ã¢ãªãªã¼ã¯ãçãããå ´åã¯ãã¡ã¢ãªãããã¡ã¤ãªã³ã°ãã¼ã«ãå½¹ã«ç«ã¡ã¾ãã
ã¹ã¯ãã㯠Provate Space ã®ä¸é¨ã® dyno (ä¾: Private-M) ã«ã¯ä½¿ç¨ã§ãã¾ãããã¡ã¢ãªå²ãå½ã¦ãå¤§å¹ ã«è¶ éãã dyno ã¯ãR15 ã¨ã©ã¼âãçºè¡ãã¾ãã (ãã ããã©ãããã©ã¼ã ã¯å ´åã«ãã R15 ã¨ã©ã¼ãåé¤ãããã¨ãããã¾ã)ãã¹ã¯ããé åã使ç¨ãã¾ããã代ããã«ããã©ãããã©ã¼ã ã¯ã大éã®ã¡ã¢ãªãæ¶è²»ãã¦ããããã»ã¹ãå¼·å¶çµäºãã¾ãããdyno èªä½ãå¼·å¶çµäºããªãå ´åãããã¾ãã
å°éã®ã¹ã¯ããé åã使ç¨ããã¡ã¢ãªã¹ã¯ãããé »ç¹ã§ãªãå ´åã¯ãé常ã¯åé¡ã«ãªãã¾ãããã¢ããªã±ã¼ã·ã§ã³ãã¡ã¢ãªä¸éã«éãã¦ããªãå ´åã§ãããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ãã¡ã¢ãªã¨å©ç¨å¯è½ãªãã£ã¹ã¯ãã£ãã·ã¥ã管çãã¦ãããããå°éã®ã¡ã¢ãªããã£ã¹ã¯ã«ã¹ã¯ããããããã¨ã¯çããããã¾ããã
å¤é¨ãµã¼ãã¹ã¸ã®æ¥ç¶
dyno ä¸ã§å®è¡ããã¦ããã¢ããªã±ã¼ã·ã§ã³ã¯ãå¤é¨ãµã¼ãã¹ã«æ¥ç¶ã§ãã¾ããHeroku ã§ã¯ãã¢ããªãè¤æ°ã®å°åâã§å®è¡ã§ãããããã¬ã¤ãã³ã·ã¼ãæé©ã«ããã«ã¯ãã¢ããªã¨åãå°åâã§ãµã¼ãã¹ãå®è¡ãã¦ãã ããã
dyno ããã³ãªã¯ã¨ã¹ã
1 ã¤ã® dyno 㯠1 ç§ãããæ°åã®ãªã¯ã¨ã¹ãã«å¯¾å¿ã§ãã¾ãããããã©ã¼ãã³ã¹ã¯ä½¿ç¨ããè¨èªã¨ãã¬ã¼ã ã¯ã¼ã¯ã«ãã£ã¦å¤§ããç°ãªãã¾ãã
ã·ã³ã°ã«ã¹ã¬ããã®ãé並å Web ãã¬ã¼ã ã¯ã¼ã¯ (ããã©ã«ãè¨å®ã® Rails 3 ãªã©) ã§ã¯ãä¸åº¦ã« 1 ã¤ã®ãªã¯ã¨ã¹ããå¦çã§ãã¾ããåãªã¯ã¨ã¹ãã®å¦çã«å¹³å㧠100ms ãããã¢ããªã®å ´åãdyno ããã 1 ç§ã«ç´ 10 åã®ãªã¯ã¨ã¹ããå¦çãããã¨ã«ãªããæé©ã§ã¯ããã¾ããã
ã·ã³ã°ã«ã¹ã¬ããã®ããã¯ã¨ã³ãã¯ã並åãªã¯ã¨ã¹ãã®å¦çãååã§ãªããããæ¬çªç°å¢ã®ã¢ããªã«ã¯æ¨å¥¨ããã¾ãããæ¬çªç°å¢ã®ãµã¼ãã¹ãéçºããã³å®è¡ããå ´åã¯ã常ã«ä¸¦åããã¯ã¨ã³ããé¸æãã¦ãã ããã
JavaãUnicornãEventMachineãNode.js ãªã©ã®ãã«ãã¹ã¬ããã¾ãã¯ã¤ãã³ãé§ååã®ç°å¢ã§ã¯ãå¤æ°ã®ä¸¦åãªã¯ã¨ã¹ããå¦çã§ãã¾ãããªã¯ã¨ã¹ãã®ã¹ã«ã¼ããããç¹å®ããå¯ä¸ã®å®éçãªæ¹æ³ã¯ãã¢ããªã®è² è·ãã¹ãã§ãã