ããã«ã¡ã¯ãå°è¥¿ã§ãã
æ°ãã¤ãããå¹´ãå¤ãã£ã¦ãã¾ããã2016å¹´ã¯ããã°ãæ¸ãå¹´ã«ãããã¨æãã¾ãã
ãã¦ãGoogle App Engine (GAE)ããåç¥ã§ããããï¼
- ãç¥ã£ã¦ããã¼ãGoogle ããã£ã¦ãPaasã§ãããã§ãä»äºãã使ããªãããã¼ãã
- ãJavaã¨Pythonã ãã§ããï¼ã
- ããããããµã管çç»é¢ã®ãã¤ã§ããï¼ã
ããããã¤ã¡ã¼ã¸ã®æ¹ãçµæ§å¤ãããããªãã§ããããã åãå«ããGAEãåºãå½å触ã£ã¦ä»¥æ¥ãã¨ããæ¹ã¯ãä¸ã®å°è±¡ãæ£ããã¨æãã¾ãã
åãããããå°è±¡ã ã£ãã®ã§ããããã¤ã®ã¾ã«ãPHPãæ£å¼å¯¾å¿ãã¦ããã®ã«æ°ã¥ãã軽ã使ã£ã¦ã¿ãããé常ã«ããã£ãã®ã§ãä»æ¥ã¯ãã®è©±ããã¾ãã*1
GAEã¨ã¯ï¼
GAEã¯ãGoogle ããã£ã¦ããPaasã®ãµã¼ãã¹ã§ãã
- å¿ è¦ãªä½æ¥ã¯ãã½ã¼ã¹ã³ã¼ãããããã¤ããã ã
- Paasãªã®ã§ã¤ã³ãã©ã®å¿é ãããªãã¦ããï¼æé«ï¼ï¼
- ç¡ææ ã大ãããç¡æéç¨ãå¯è½ï¼
- Python, Go, Java, PHPã®4è¨èªã«å¯¾å¿
- Google ã®æå¼·ã®ã¨ãã¸ãã£ãã·ã¥ã使ããï¼éçãã¡ã¤ã«ç¨CDNï¼
ãã¨ãã¨Pythonãjavaã®ã³ã¼ãããããã¤ã§ãã¦ãGoogle ã®ã¤ã³ãã©ã§åãããããã¨ããåä½ã®ãµã¼ãã¹ã ã£ãã®ã§ããããã¤ã®ã¾ã«ããGoogleããã£ã¦ããã¯ã©ã¦ããµã¼ãã¹ Google Cloud Platform (GCP)ã«çµã¿è¾¼ã¾ãã¦ãã¾ããã
ããããã®çç±
ããããã®çç±â ãå®ãï¼æéæ°åä¸PVè¦æ¨¡ãªãç¡æã§ã®éç¨ãå¯ï¼
ãã¯ããã¡ã°ãã®çç±ã¯ããå®ããã§ãããããã¦ãç¡ææ ãå¤ãã®ã§ãå¤ãã®ãµã¤ãã§ç¡æã§ã®éç¨ãã§ããã¨æãã¾ãããããããé常ã®ãµã¤ãã§æ°åä¸PVè¦æ¨¡ã§ããã°ååç¡ææ ã«åã¾ãããããªãã§ããããã
主ãªã³ã¹ãã¯ãã¤ã³ã¹ã¿ã³ã¹ã®ç¨¼åæéã«å¯¾ãã課éã«ãªããã¨æãã¾ããããã¡ãã¯28æéã¾ã§ç¡æã§ãã
ã¤ã¾ã24æéã®ãã¡20æéã¯1ã¤ã³ã¹ã¿ã³ã¹ã4æéã¯2ã¤ã³ã¹ã¿ã³ã¹ç¨¼åããã¤ã¡ã¼ã¸ã§ãã ãµã¤ãã«ãããã¨æãã¾ãããç§ãéç¨ãã¦ããæé50ä¸PVã»ã©ãããµã¤ãã§ã¯ããã®æ å ã§åé¡ãªãéç¨ã§ãã¦ãã¾ãã
ããããã®çç±â¡ãéçºã»éç¨ã楽
ã½ã¼ã¹ã³ã¼ãã®ã«ã¼ããã£ã¬ã¯ããªã«app.yaml
ã¨ããããã¸ã§ã¯ãåãç°å¢ãè¨ãããã¡ã¤ã«ãããã¦ãSDKã®ã³ãã³ãã§ãããã¤ããã ãã§ããµã¤ãæ§ç¯ä½æ¥å®äºã§ãã
ãã¨ã¯ããããã¸ã§ã¯ãå.appspot.comãã¨ããURLã«ã¢ã¯ã»ã¹ããããã³ã«Googleã®ã¤ã³ãã©ä¸ã§ãã¤ã³ã¹ã¿ã³ã¹ããç«ã¡ãã¢ã¯ã»ã¹ããã°ãã¦ããã¾ãã
ãã®ãã¤ã³ã¹ã¿ã³ã¹ãã¯ããµã¼ãã¼ã¨ããããã¯ãã1ããã»ã¹ãã«è¿ãã§ããã¢ã¯ã»ã¹ããã£ã¦ããç«ã¡ä¸ããã¨ããã¨ãç«ã¡ä¸ããé ããã§ããã3-5ç§ãããã§ç«ã¡ä¸ããã¾ãã
ãã¾ã¾ã§VPSã ã£ããAWSã®EC2ã§éç¨ãã¦ãã¾ãããããã°ãã¼ãã¼ã·ã§ã³ãã¡ããã¨åãã¦ãªãã£ããããã¾ã«ãããããã¦ãããä½ãã¨é¢åãªä½æ¥ãçºçãã¾ããããããããé¢åãªéç¨ããå®å ¨ã«éæ¾ããã¾ãã
ã¾ãããã¼ã«ã«ç¨ã®éçºç°å¢ãã¤ãã¦ããã®ã§ãMAMPã¨ããå ¥ããæéãããã¾ããã
ããããã®çç±â¢ãã¹ã±ã¼ã«ãã
GAEã¯ããã©ã«ãã§AutoScalingã®èãæ¹ã§è¨è¨ããã¦ãã¾ããã¢ã¯ã»ã¹ãå¢ããã¨ã¤ã³ã¹ã¿ã³ã¹ãå¢ããæ¸ãã¨ã¤ã³ã¹ã¿ã³ã¹ãæ¸ãã¾ãã ãããGCEã¨ãAWSã®EC2ã¨ãã ã¨é常ã«é¢åã§ããããã
ããã§ã¢ã¯ã»ã¹ãéä¸ããéã®å®å¿ãããã¤ã¤ã平常æã®ã³ã¹ãã¯æå°ã«æãããã¾ãã
è¨å®èªä½ã¯Apacheã®Preforkã¿ãããªãã©ã¡ã¼ã¿ã§èª¿æ´ãã¾ãã
ããããã®çç±â£ãå¿ è¦ãªãã®ã大ä½å ¥ã£ã¦ãã
大ä½ä½¿ãã§ããããµã¼ãã¹ãGAEã®ç¡ææ ã§ä½¿ãã¾ãã
Memcache
ç¡ææ ã§ä½¿ãã¾ãããã®ãµã¼ãã¼ã¯ãã«ããã¼ã¸ããµã¼ãã¹ã¨ãã¦å©ç¨ã§ããã¤ã³ã¹ã¿ã³ã¹æéã¯æ¶è²»ãã¾ãã*2ã
AWSã®ElastiCacheã«ä¼¼ã¦ãã¾ããããã®Memcacheãµã¼ãã¯ElastiCacheã¨éã£ã¦èªåã§ã¹ã±ã¼ã«ããã®ã§ã空æ°ã¿ããã«å©ç¨ã§ãã¾ãã
Data Store
NoSQLãµã¼ãã¹ã§ããAWSã®DynamoDBã«è¿ãã§ãããããã¥ã¡ã³ããèªãã æãã¯ãDynamoDBããã¯æè»ããã§ãã
æ®å¿µãªãããMySQLãªã©ã®RDBMSã使ç¨ãããå ´åã¯ãCloud SQLã¨ãããµã¼ãã¹ãå©ç¨ãããã諦ãã¦ããã使ãå¿ è¦ãããã¾ãã DataStoreã¸ã®å¯¾å¿ã¯SDKçµç±ã§ãããªãã¨ãããªãã®ã§ãäºå®ä¸ä¸å¯è½ãªã®ã§ãCloud SQLã使ããã¨ã«ãªããã¨æãã¾ãã
Data Storeã«å¯¾å¿ããããã«æ¸ãã¦ããã°ã¹ã±ã¼ã«ããã®ã§ãå®å¿ã§ããããã®å¾GAEããæããããªããªãã¾ããã»ã»
ã¨ãã¸ãã£ãã·ã¥
ãã¾ããµã¤ãã§ã¯ããã·ã¥ããã¦ããªãã®ã§ãããããã ãã§ãGAEã使ãçç±ã«ãªãããããªããã¨å人çã«æãã®ãããã®ã¨ãã¸ãã£ãã·ã¥ã§ãã
CDNã¿ãããªãã®ãªã®ã§ãããç¹ã«ä½ãè¨å®ããªãã¦ããcssãjsãç»åãªã©ã®éçãã¡ã¤ã«ã¯åæã«ãã£ãã·ã¥ããã¾ãã
HTMLããã£ãã·ã¥ããã¨ãã¯ãHTTPã®ãããã¼ã«cache-control
ãã¤ããã°OKã§ãã
GAEã§ã¯WordPressãåãã®ã§ãGAEã«ç§»åãã¦ãã®ãããã¤ããã ãã§ãçéã«ãªãã¨æãã¾ãã
Cloud Storage
éçãã¡ã¤ã«ãã¹ãã£ã³ã°ãããã¾ããAWSã§ããã¨ããã®S3ããããã¯ã©ã¦ãã§ããã¨ããã®ãªãã¸ã§ã¯ãã¹ãã¬ã¼ã¸ã§ããã
ãã°
ãã°ä¿åç¨ã®ãµã¼ãã¹ãç¨æããã¦ãã¾ããããã°ã©ã ããsyslogã«éã£ããã°ããã©ã¦ã¶ãã確èªã§ãã¾ãã ãã°ã®ä¿ç®¡ãå°å³ã«é¢åãªãã§ãããããã°ããã¡ããªã¯ã¹ä½ã£ã¦ãã¢ã©ã¼ãé£ã°ããã¨ããã®ããCloudMonitoringã¨ã®é£æºã§å¯è½ã§ãã
Cloud Monitoring
ç£è¦ãµã¼ãã¹ã§ããã¡ããªã¯ã¹ã®åéã¨è¡¨ç¤ºãã¢ã©ã¼ãã®éä¿¡ãã¤ã³ã·ãã³ãã®ç®¡çãã§ãã¾ããAWSã§ããã¨ãCloudWatch+SNSã¨ããæãã§ãã ãã®ãµã¼ãã¹ã¯Googleãè²·åããstackdriverã®ãµã¼ãã¹ã使ããããã«ãªã£ã¦ãã¾ãï¼ä»ã¯ç¡æï¼ã
Cloud DNS
DNSãµã¼ãã¼ã§ããSaaSãªã®ã§ã管çç»é¢ã§ããããããã ãã§è¨å®å®äºã§ããAWSã§ããã¨Route53ã§ããã
ãã¡ãã¯ææã§ããã1ã¾ã¼ã³ããã0.2ãã«ãªã®ã§ãæ100åããããªãããããã¨æãã¾ãã ä»ã¾ã§ãã¡ã¤ã³æ¥è ã®ã¬ã³ã¿ã«DNSãµã¼ãã¼ã使ã£ã¦ãæ¹ã¯ç´ã¡ã«ç§»è¡ãã¦ããã¬ãã«ãªããããªãã§ããããã
ããã¯GAEã®ãµã¼ãã¹ã§ã¯ãªãã®ã§ã使ã£ãå課éããã¾ãã
ãã®ä»
cron, ã¿ã¹ã¯ãã¥ã¼ãªã©ãããã
æ®å¿µãªç¹
- æ¥æ¬ã«ãã¼ã¿ã»ã³ã¿ã¼ããªãï¼ï¼ããã¯çµæ§çãã§ãã»ã»ã»è¥¿æµ·å²¸ã®ãªã¼ã¸ã§ã³ã«ãã¦ãã©ããªè»½ãå¦çã§ãæ°ç¾msããã£ã¦ãã¾ãã¾ãããï¼
- ç¡ææ ãè¶ ãã¦ããã¯ãã¾ãå®ããªãï¼éç¨ããªãã¨ä½ã¤ã³ã¹ã¿ã³ã¹å¿ è¦ãªã®ãããããªãã®ãæãã§ããããï¼
- PHPã®SDKãDataStoreã«å¯¾å¿ãã¦ããªãã»ã»ã»ãªãããï¼ä»ã®è¨èªã¯å¯¾å¿ãã¦ããã®ã«ã»ã»ï¼
- PHPã ã¨curlã®å¯¾å¿ããªãã®ã§ãæ¸ãç´ããå¿ è¦*3
ãããªãµã¤ãã«ãããã
- ã¢ã¯ã»ã¹ã®å¤§åãã»ã¨ãã©é²è¦§
- ã¤ã³ãã©ã®é¢åãè¦ãããªã
- ã³ã¹ããæå°ã«ããã
- PVãæéæ°åä¸è¦æ¨¡ã¨å°è¦æ¨¡
- WordPressã§éç¨ãã¦ãã
- PHPã§ãµã¤ããä½ã£ã¦ã¿ããï¼ç·´ç¿ç¨ã¨ãã¦æé©ï¼
WordPressã«ã¤ãã¦ã¯ãGoogleãå°å ¥æé ã以ä¸ã«ã¾ã¨ãã¦ãã¾ãã GitHub - GoogleCloudPlatform/appengine-php-wordpress-starter-project: Starter project for running WordPress on Google Cloud Platform
ã¾ã¨ã
表示ãããã ãã®ãã£ã³ãã¼ã³ãµã¤ããä½ãã®LPãWordPressã§åãã¦ããã¡ãã£ã¨ãããµã¤ããªã©ãRDBMSã®è¦ããªãã·ã¹ãã ã§ããã°ãå ¨é¨GAEã§å¯¾å¿ãã¡ãã£ã¦ããããããªããã¨æãã¾ããRDBMSãå¿ è¦ã§ããDBã ãCloud SQLã§ããã®ãããã§ããã
ããã°ãLPãªã©ã人ã«ãã£ã¦ã³ã³ãã³ããå¤ããå¿ è¦ã®ãªããµã¤ãã®å ´åãGoogle ã®ã¨ãã¸ãã£ãã·ã¥ã使ããã®ã¯ãã«ããã§ããã
AWSã«ã¯GAEã¿ãããªãµã¼ãã¹ã¯ãªãã®ã§ãä»å¾åºã¦ããããï¼ ããã¯ããã§æ¥½ãã¿ã
ã¨ãããã使ã£ã¦ã¿ãæ¹ã¯ãã¡ãï¼
æ¬å½ã«5åã§ãããã¤ã¾ã§ããã¡ããã¾ãã
ç¡æã§éç¨ãããæ¹ã¯ãã¡ãï¼
Standard Environment 㨠Flexible Environmentã«ã¤ãã¦
ãã®è¨äºã¯ãApp Engine Standard Environmentãã®ãã®ã§ãã
è£ã§VMãç«ã¡ä¸ãã£ã¦SSHãã°ã¤ã³ãã§ãããããããApp Engine Flexible Environmentãï¼æ§Managed VMs=MVMsï¼ã¨ããã®ãããã¾ããããã¡ãã®ã»ããéç¨è² è·ã»å°å ¥ã®é£æ度ãä¸ãã代ããã«ãèªç±åº¦ãå¢ãã¾ãã ãã ãã¡ãã¯ãå ¬å¼ã«ã¯PHPã¯å¯¾å¿ãã¦ããªãã®ã¨ãã¾ã beta ãªã®ã§ããã®è¨äºã§ã¯ã¹ã«ã¼ãã¾ããã
å ¬å¼ãµã¤ãï¼ App Engine - Platform as a Service | Google Cloud Platform
ã¡ãªã¿ã«â ããããã®ãµã¤ãã§ã®éç¨ç¶æ³
åã¨ãã¦ã¯å°ãã§ãGAE人å£ãå¢ãã¦æ å ±ãå¢ãããã¨ã¦ãå¬ããã§ãã
ã¡ãªã¿ã«ã以ä¸ã®ãµã¤ãã¯æé50ä¸PVãããããã¾ããã12æã«GAEã«ç§»è¡ããããã¾ã§å®å ¨ç¡æã§éç¨ãã¦ãã¾ãã
両æ¹å ±ãããããã¼ã¸ã¯ã¨ãã¸ãã£ãã·ã¥ãå¹ãããã«ãªã£ã¦ããã®ã§ãäºåç®ã¯50msãããã§è¡¨ç¤ºã§ããã®ããããã¨æãã¾ãã
ã¡ãªã¿ã«â¡ãHerokuããè¯ãç¹
ã¤ã¡ã¼ã¸ã¨ãã¦ã¯Herokuã«è¿ãã§ãããHerokuã¨æ¯ã¹ãã¨ã以ä¸ã®éããããã¾ãã
- å®ãï¼ã¨ãããç¡ææ ã大ããï¼
- Googleã®å·¨å¤§ã¤ã³ãã©ã«ãã®ã¾ã¾ä¹ã£ãããï¼ã¨ã³ã¸ãã¢çãªæ°æã¡ããããããï¼
- ã³ã³ã½ã¼ã«ï¼ç®¡çç»é¢ï¼ããã£ãããï¼ãã大äºã§ãããï½ï¼