{"id":583,"date":"2025-06-01T12:05:38","date_gmt":"2025-06-01T03:05:38","guid":{"rendered":"https:\/\/tako.nakano.net\/blog\/?p=583"},"modified":"2025-06-01T12:05:38","modified_gmt":"2025-06-01T03:05:38","slug":"zero-scale-wordpress","status":"publish","type":"post","link":"https:\/\/tako.nakano.net\/blog\/2025\/06\/zero-scale-wordpress\/","title":{"rendered":"Zero Scale WordPress"},"content":{"rendered":"<h1>Zero Scale WordPress<\/h1>\n<h2>\u6982\u8981<\/h2>\n<p>\u3010\u30b3\u30b9\u30c8\u524a\u6e1b\u3011WordPress\u3092\u8ce2\u304f\u904b\u7528\uff01Cloud Run\u3067\u5b9f\u73fe\u3059\u308b\u7a76\u6975\u306e\u30bc\u30ed\u30b9\u30b1\u30fc\u30eb\u8853<\/p>\n<p>WordPress \u30b5\u30a4\u30c8\u3001\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u6642\u3082\u30b5\u30fc\u30d0\u30fc\u4ee3\u304c\u304b\u304b\u3063\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u500b\u4eba\u30d6\u30ed\u30b0\u3084\u5c0f\u898f\u6a21\u30b5\u30a4\u30c8\u3060\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u7dad\u6301\u8cbb\u304c\u610f\u5916\u3068\u91cd\u8377\u3067\u3059\u3088\u306d\u2026\u3082\u3057\u3001WordPress\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u6642\u3060\u3051\u8cbb\u7528\u304c\u767a\u751f\u3059\u308b\u4ed5\u7d44\u307f\u304c\u3042\u3063\u305f\u3089\u2026\uff1f\u3068\u601d\u3063\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n<p>\u305d\u3093\u306a\u60a9\u307f\u3092\u62b1\u3048\u308b\u3042\u306a\u305f\u306b\u6717\u5831\u3067\u3059\uff01\ud83c\udf89<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001WordPress \u306e\u904b\u7528\u30b3\u30b9\u30c8\u3092\u9650\u308a\u306a\u304f\u30bc\u30ed\u306b\u8fd1\u3065\u3051\u308b\u753b\u671f\u7684\u306a\u4ed5\u7d44\u307f\u3001\u300cZero Scale WordPress\u300d\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002Google Cloud \u306e\u6700\u5148\u7aef\u6280\u8853\u3092\u99c6\u4f7f\u3057\u3001<strong>\u300c\u4f7f\u308f\u306a\u3044\u6642\u306f\u304a\u91d1\u304c\u304b\u304b\u3089\u306a\u3044\u300d<\/strong> WordPress \u74b0\u5883\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u3001\u4f59\u3059\u3068\u3053\u308d\u306a\u304f\u89e3\u8aac\u3057\u307e\u3059\uff01<\/p>\n<p>\u3067\u3082\u5b9f\u306f\u3001\u3053\u306e\u8a71\u3001WordPress \u306b\u9650\u3089\u306a\u3044\u3093\u3067\u3059\u3002Zero Scale Rails \u3084 Zero Scale Laravel \u306a\u3069\u3001\u4ed6\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084 CMS \u306b\u3082\u5fdc\u7528\u53ef\u80fd\u306a\u8003\u3048\u65b9\u306a\u3093\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u30ea\u30bd\u30fc\u30b9\u3092\u52b9\u7387\u7684\u306b\u4f7f\u3046\u305f\u3081\u306e\u65b0\u3057\u3044\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u3053\u3053\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u624b\u6cd5\u306e\u6280\u8853\u7684\u306a\u30ad\u30e2\u306f\u3001Cloud Run \u306e\u300c\u8d77\u52d5\u30d7\u30ed\u30fc\u30d6\uff08Startup Probe\uff09\u300d\u3092\u5229\u7528\u3057\u3066\u3001\u5fc5\u8981\u306a\u8981\u7d20\uff08\u4f8b\u3048\u3070\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff09\u3092\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3057\u3001\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u6642\u306f\u81ea\u52d5\u7684\u306b\u505c\u6b62\u3055\u305b\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001WordPress \u306e\u300c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u300d\u304c\u5e38\u6642\u8d77\u52d5\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u30b3\u30b9\u30c8\u3092\u5927\u5e45\u306b\u524a\u6e1b\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u3001<a href=\"https:\/\/zero-wp.cloud.tako.nakano.net\/\">Zero Scale WordPress<\/a> \u3068\u3044\u3046\u30c7\u30e2\u30b5\u30a4\u30c8\u3082\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u4e00\u5ea6\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u6700\u521d\u306e\u63a5\u7d9a\u3060\u3051\u30011\u5206\u307b\u3069\u5f85\u305f\u3055\u308c\u307e\u3059\u304c\u3001\u305d\u306e\u5f8c\u306f\u30b9\u30e0\u30fc\u30ba\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u8d77\u52d5\u3059\u308b\u307e\u3067\u306e\u6642\u9593\u3067\u3059\u3002<\/p>\n<h2>\u300cZero Scale WordPress\u300d\u3063\u3066\u4f55\u304c\u305d\u3093\u306a\u306b\u30b9\u30b4\u3044\u306e\uff1f<\/h2>\n<p>\u4e00\u756a\u306e\u9b45\u529b\u306f\u3001\u306a\u3093\u3068\u3044\u3063\u3066\u3082\u5287\u7684\u306a\u30b3\u30b9\u30c8\u524a\u6e1b\u52b9\u679c\u3067\u3059\uff01<\/p>\n<p>\u901a\u5e38\u3001WordPress \u3092\u52d5\u304b\u3059\u305f\u3081\u306b\u306f\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u3068\u306f\u5225\u306b MySQL \u306a\u3069\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u5e38\u6642\u8d77\u52d5\u3055\u305b\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u3001\u3053\u308c\u304c\u56fa\u5b9a\u8cbb\u3068\u3057\u3066\u306e\u3057\u304b\u304b\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u300cZero Scale WordPress\u300d\u306a\u3089\u3001WordPress\u30b3\u30f3\u30c6\u30ca\uff08\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\uff09\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u6642\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\uff08Google Compute Engine \u306e VM \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff09\u3092\u81ea\u52d5\u7684\u306b\u505c\u6b62\u3055\u305b\u307e\u3059\u3002\u518d\u3073\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308c\u3070\u77ac\u6642\u306b\u8d77\u52d5\u3057\u3001WordPress \u304c\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u30012025-05 \u6642\u70b9\u306e\u8a66\u7b97\u3067\u306f\u3001\u5e38\u6642\u8d77\u52d5\u3067\u3082\u6708\u984d$3.50\u7a0b\u5ea6\uff08T2D Spot\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 $3.10 + \u6a19\u6e96\u6c38\u7d9a\u30c7\u30a3\u30b9\u30af $0.40 \u203b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u8cbb\u7528\u5225\u9014\uff09\u3067\u904b\u7528\u3067\u304d\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u3001\u3053\u306e\u4ed5\u7d44\u307f\u3067\u505c\u6b62\u3055\u305b\u308b\u3053\u3068\u306b\u6210\u529f\u3059\u308c\u3070\u3001\u3053\u308c\u3088\u308a\u3082\u3055\u3089\u306b\u5b89\u304f\u904b\u7528\u3067\u304d\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u306e\u3067\u3059\u3002\u307e\u3055\u306b\u3001\u4f7f\u3063\u305f\u5206\u3060\u3051\u306e\u652f\u6255\u3044\u306b\u8fd1\u3065\u3051\u308b\u5922\u306e\u3088\u3046\u306a\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u306b\u3082\u2026<\/p>\n<ul>\n<li><strong>\u52b9\u7387\u7684\u306a\u30ea\u30bd\u30fc\u30b9\u6d3b\u7528<\/strong>: \u5fc5\u8981\u306a\u6642\u3060\u3051\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u3046\u306e\u3067\u3001\u7121\u99c4\u306a\u96fb\u529b\u6d88\u8cbb\u3092\u6291\u3048\u3001\u304a\u8ca1\u5e03\u306b\u3082\u74b0\u5883\u306b\u3082\u512a\u3057\u3044\uff01<\/li>\n<li><strong>\u9ad8\u3044\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3<\/strong>: Google Cloud Run\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u6025\u306a\u30a2\u30af\u30bb\u30b9\u5897\u306b\u3082\u81ea\u52d5\u3067\u30b9\u30b1\u30fc\u30eb\u3057\u3066\u5bfe\u5fdc\u53ef\u80fd<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u5229\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u3069\u3046\u3084\u3063\u3066\u5b9f\u73fe\u3059\u308b\u306e\uff1f \u300c\u30bc\u30ed\u30b9\u30b1\u30fc\u30eb\u300d\u306e\u9b54\u6cd5\u306e\u30bf\u30cd<\/h2>\n<p>\u3053\u306e\u300c\u30bc\u30ed\u30b9\u30b1\u30fc\u30eb\u300d\u3092\u5b9f\u73fe\u3057\u3066\u3044\u308b\u4e3b\u8981\u306a\u6280\u8853\u3068\u4ed5\u7d44\u307f\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<h3>WordPress on Cloud Run<\/h3>\n<p>\u307e\u305a\u3001WordPress \u81ea\u4f53\u306f Google Cloud \u306e\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u30b3\u30f3\u30c6\u30ca\u5b9f\u884c\u74b0\u5883\u3067\u3042\u308b Cloud Run \u4e0a\u3067\u52d5\u304b\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u6642\u306f\u30b3\u30f3\u30c6\u30ca\u304c0\u306b\u306a\u308a\u3001\u8cbb\u7528\u304c\u767a\u751f\u3057\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u8d77\u52d5 (Startup Probe)<\/h3>\n<p>Cloud Run \u306e\u300c\u8d77\u52d5\u30d7\u30ed\u30fc\u30d6\uff08Startup Probe\uff09\u300d\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>WordPress \u30b3\u30f3\u30c6\u30ca\u304c\u8d77\u52d5\u3059\u308b\u969b\u3001\u307e\u305a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff08\u3053\u3053\u3067\u306f Google Compute Engine \u4e0a\u306e \u306eMySQL \u30b5\u30fc\u30d0\u30fc\uff09\u306b\u63a5\u7d9a\u3092\u8a66\u307f\u307e\u3059\u3002<br \/>\n\u3082\u3057\u63a5\u7d9a\u3067\u304d\u306a\u3051\u308c\u3070\uff08DB \u304c\u505c\u6b62\u3057\u3066\u3044\u308c\u3070\uff09\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u304c Compute Engine \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u81ea\u52d5\u3067\u8d77\u52d5\uff01<br \/>\n\u7121\u4e8b DB \u304c\u8d77\u52d5\u3057\u63a5\u7d9a\u3067\u304d\u308c\u3070\u3001WordPress \u3082\u6b63\u5e38\u306b\u52d5\u304d\u51fa\u3057\u307e\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001Cloud SQL \u3067\u306f\u306a\u304f Compute Engine \u3092\u63a1\u7528\u3057\u305f\u306e\u306f\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8d77\u52d5\u304c\u3088\u308a\u9ad8\u901f\u3060\u3063\u305f\u305f\u3081\u3001\u3068\u3044\u3046\u5b9f\u8df5\u7684\u306a\u7406\u7531\u304b\u3089\u3067\u3059\u3002Cloud SQL \u3067\u3082\u539f\u7406\u7684\u306b\u306f\u540c\u3058\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u8d77\u52d5\u6642\u9593\u304c\u9577\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u81ea\u52d5\u505c\u6b62 (Monitoring &amp; Pub\/Sub &amp; Cloud Functions)<\/h3>\n<p>Cloud Run \u306e\u30b3\u30f3\u30c6\u30ca\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u6570\u304c0\u306b\u306a\u3063\u305f\uff08\u3064\u307e\u308a\u30a2\u30af\u30bb\u30b9\u304c\u306a\u304f\u306a\u3063\u305f\uff09\u72b6\u614b\u3092 Google Cloud Monitoring \u304c\u691c\u77e5\u3057\u307e\u3059\u3002<br \/>\n\u30a2\u30af\u30bb\u30b9\u304c\u306a\u304f\u306a\u3063\u3066\u304b\u3089\u4e00\u5b9a\u6642\u9593\u5f8c\uff08\u4f8b: 10\u5206\u5f8c\uff09\u3092\u691c\u77e5\u3057\u3001Pub\/Sub \u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u306b\u901a\u77e5\u304c\u9001\u3089\u308c\u307e\u3059\u3002<br \/>\n\u3053\u306e\u901a\u77e5\u3092\u30c8\u30ea\u30ac\u30fc\u3068\u3057\u3066\u3001Cloud Functions \u3067\u7528\u610f\u3057\u305f\u5c0f\u3055\u306a\u95a2\u6570\u304c\u5b9f\u884c\u3055\u308c\u3001Compute Engine \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\uff08MySQL \u30b5\u30fc\u30d0\u30fc\uff09\u3092\u81ea\u52d5\u7684\u306b\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u306f\u3057\u3063\u304b\u308a\u6c38\u7d9a\u5316<\/h3>\n<p>WordPress \u306e\u6295\u7a3f\u30c7\u30fc\u30bf\u3084\u8a2d\u5b9a\u306f Compute Engine \u306e\u6c38\u7d9a\u30c7\u30a3\u30b9\u30af\u306b\u4fdd\u5b58\u3002<br \/>\n\u753b\u50cf\u306a\u3069\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb (<code>wp-content\/uploads<\/code>) \u306f\u3001Cloud Storage \u306b\u4fdd\u5b58\u3057\u3001Cloud Run \u304b\u3089\u30de\u30a6\u30f3\u30c8\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u304c\u505c\u6b62\u3057\u3066\u3082\u30c7\u30fc\u30bf\u306f\u5b89\u5168\u3067\u3059\u3002<\/p>\n<h3>\u30e2\u30c0\u30f3\u306a\u69cb\u6210\u7ba1\u7406<\/h3>\n<p>WordPress \u672c\u4f53\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3084\u3001\u30c6\u30fc\u30de\u30fb\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u7ba1\u7406\u306f Composer \u3092\u4f7f\u7528\u3057\u3001\u30e2\u30c0\u30f3\u3067\u52b9\u7387\u7684\u306a\u958b\u767a\u30fb\u904b\u7528\u30d5\u30ed\u30fc\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3089\u306e\u4ed5\u7d44\u307f\u3092\u9023\u643a\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u300c\u5fc5\u8981\u306a\u6642\u3060\u3051\u8d77\u52d5\u3057\u3001\u4e0d\u8981\u306b\u306a\u3063\u305f\u3089\u505c\u6b62\u3059\u308b\u300d\u3068\u3044\u3046\u7406\u60f3\u7684\u306a WordPress \u74b0\u5883\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u69cb\u6210\u56f3\u3092\u898b\u3066\u3044\u305f\u3060\u304f\u3068\u3001\u5168\u4f53\u306e\u6d41\u308c\u304c\u3088\u308a\u30a4\u30e1\u30fc\u30b8\u3057\u3084\u3059\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/docs.google.com\/presentation\/d\/e\/2PACX-1vSclnELGPyob6uy68TSG6QaRyVghZMtIGuWk627I4Dx4M4fv5G7iIoKxyyOrQ9ChECaztjRlE7h5C5x\/pubembed?start=false&#038;loop=false&#038;delayms=3000\" frameborder=\"0\" width=\"480\" height=\"299\" allowfullscreen=\"true\" mozallowfullscreen=\"true\" webkitallowfullscreen=\"true\"><\/iframe><\/p>\n<h2>\u300cZero Scale WordPress\u300d\u3092\u4f53\u9a13\u3057\u3088\u3046<\/h2>\n<p>\u300c\u81ea\u5206\u3082\u8a66\u3057\u3066\u307f\u305f\u3044\uff01\u300d\u3068\u601d\u3063\u305f\u65b9\u3001\u7d20\u6674\u3089\u3057\u3044\u3067\u3059\u3002\u3053\u306e\u300cZero Scale WordPress\u300d\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u8a73\u7d30\u306a\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7fa4\u3084\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u3059\u3079\u3066\u4ee5\u4e0b\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/takotakot\/zeroscale-wp\">Zero Scale WordPress &#8211; GitHub\u30ea\u30dd\u30b8\u30c8\u30ea<\/a> <a href=\"https:\/\/github.com\/takotakot\/zeroscale-wp\">https:\/\/github.com\/takotakot\/zeroscale-wp<\/a><\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u5185\u306e README.md \u306b\u306f\u3001\u3055\u3089\u306b\u8a73\u7d30\u306a\u6280\u8853\u60c5\u5831\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5fc5\u8981\u306a\u3082\u306e (\u3056\u3063\u304f\u308a):<\/p>\n<ul>\n<li>Google Cloud \u30a2\u30ab\u30a6\u30f3\u30c8<\/li>\n<li>Docker\u53ca\u3073\u30b3\u30f3\u30c6\u30ca\u306b\u95a2\u3059\u308b\u57fa\u672c\u7684\u306a\u77e5\u8b58<\/li>\n<li>gcloud \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb<\/li>\n<\/ul>\n<p>\u4e3b\u306a\u8a2d\u5b9a\u30dd\u30a4\u30f3\u30c8:<\/p>\n<ul>\n<li><strong>Cloud Storage \u30d0\u30b1\u30c3\u30c8\u306e\u69cb\u6210<\/strong>: WordPress \u306e\u30b3\u30a2\u30d5\u30a1\u30a4\u30eb\u3084\u30c6\u30fc\u30de\u30fb\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30d0\u30b1\u30c3\u30c8\u306e\u6e96\u5099<\/li>\n<li><strong>Cloud Build \u306e\u69cb\u6210<\/strong>: Docker \u30a4\u30e1\u30fc\u30b8\u306e\u30d3\u30eb\u30c9\u3068\u30c7\u30d7\u30ed\u30a4\u3092\u81ea\u52d5\u5316\u3059\u308b <code>cloudbuild.yaml<\/code> \u306e\u8a2d\u5b9a<\/li>\n<li><strong>Cloud Run \u306e\u69cb\u6210<\/strong>: \u74b0\u5883\u5909\u6570\uff08\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u60c5\u5831\u306a\u3069\uff09\u3084\u3001\u524d\u8ff0\u306e Startup Probe (<code>startup_gce.php<\/code>) \u306e\u8a2d\u5b9a<\/li>\n<li><strong>Cloud Functions \u306e\u69cb\u6210<\/strong>: Compute Engine \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u505c\u6b62\u3055\u305b\u308b\u95a2\u6570\u306e\u30c7\u30d7\u30ed\u30a4<\/li>\n<\/ul>\n<p>\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u6280\u8853\u7684\u306a\u77e5\u8b58\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u304c\u3001\u30b3\u30b9\u30c8\u3092\u5287\u7684\u306b\u524a\u6e1b\u3067\u304d\u308b\u53ef\u80fd\u6027\u3092\u79d8\u3081\u305f\u3053\u306e\u4ed5\u7d44\u307f\u3001\u6311\u6226\u3057\u3066\u307f\u308b\u4fa1\u5024\u306f\u5341\u5206\u306b\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081\uff1aWordPress\u904b\u7528\u306e\u65b0\u3057\u3044\u30ab\u30bf\u30c1<\/h2>\n<p>\u300cZero Scale WordPress\u300d\u306f\u3001\u5f93\u6765\u306e\u5e38\u8b58\u3092\u8986\u3059\u3001\u65b0\u3057\u3044 WordPress \u306e\u904b\u7528\u30b9\u30bf\u30a4\u30eb\u3092\u63d0\u6848\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u5727\u5012\u7684\u306a\u30b3\u30b9\u30c8\u30e1\u30ea\u30c3\u30c8<\/li>\n<li>\u30ea\u30bd\u30fc\u30b9\u306e\u52b9\u7387\u7684\u306a\u5229\u7528<\/li>\n<li>\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u6280\u8853\u306e\u6d3b\u7528<\/li>\n<\/ul>\n<p>\u500b\u4eba\u30d6\u30ed\u30b0\u304b\u3089\u5c0f\u898f\u6a21\u306a\u30d3\u30b8\u30cd\u30b9\u30b5\u30a4\u30c8\u307e\u3067\u3001\u591a\u304f\u306e WordPress \u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u5927\u304d\u306a\u798f\u97f3\u3068\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305c\u3072\u3001GitHub \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u672a\u6765\u306e WordPress \u904b\u7528\u3092\u4f53\u9a13\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3057\u3066\u3001\u3082\u3057\u8a66\u3057\u3066\u307f\u305f\u65b9\u306f\u3001\u611f\u60f3\u3084\u6539\u5584\u70b9\u306a\u3069\u3092\u30b3\u30e1\u30f3\u30c8\u3084 GitHub \u306e Issue \u3067\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3044\u305f\u3060\u3051\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\uff01<\/p>\n<p>\u3042\u306a\u305f\u306e WordPress \u30e9\u30a4\u30d5\u304c\u3001\u3088\u308a\u5feb\u9069\u3067\u3001\u3088\u308a\u7d4c\u6e08\u7684\u306b\u306a\u308a\u307e\u3059\u3088\u3046\u306b\uff01<\/p>\n<hr \/>\n<h1>Zero Scale WordPress<\/h1>\n<h2>Overview<\/h2>\n<p>[Cost Savings] Run WordPress Smartly! Achieving Ultimate Zero Scale with Cloud Run<\/p>\n<p>Is your WordPress site racking up server costs even when there&#8217;s no traffic? For personal blogs or small-scale sites, database maintenance fees can be a surprising burden, right? Have you ever thought, &quot;What if there was a system where I only pay for WordPress when it&#8217;s actually being used?&quot;<\/p>\n<p>Well, good news for those of you with such concerns! \ud83c\udf89<\/p>\n<p>In this article, we&#8217;ll introduce the &quot;Zero Scale WordPress&quot; project, a groundbreaking mechanism to bring your WordPress operational costs as close to zero as possible. Using Google Cloud&#8217;s cutting-edge technology, we&#8217;ll thoroughly explain how to realize a WordPress environment where <strong>&quot;you don&#8217;t pay when you don&#8217;t use it!&quot;<\/strong><\/p>\n<p>But actually, this isn&#8217;t just limited to WordPress. It&#8217;s a concept applicable to other frameworks and CMSs like Zero Scale Rails or Zero Scale Laravel. In other words, what we have here is a new approach to using server resources efficiently.<\/p>\n<p>The technical key to this method is using Cloud Run&#8217;s &quot;Startup Probe&quot; to launch necessary components (like a database) on-demand and automatically stop them when there&#8217;s no access. This eliminates the need for the WordPress database to be constantly running, significantly reducing costs.<\/p>\n<p>We have also published a demo site called <a href=\"https:\/\/zero-wp.cloud.tako.nakano.net\/\">Zero Scale WordPress<\/a>, so please feel free to check it out. Please note that the very first connection may take about a minute, but after that, it will work smoothly. This initial delay is due to the time required for the database to start up.<\/p>\n<h2>What&#8217;s So Amazing About &quot;Zero Scale WordPress&quot;?<\/h2>\n<p>The biggest appeal, by far, is the dramatic cost-saving effect!<\/p>\n<p>Normally, to run WordPress, you need to keep a database server like MySQL constantly running separately from the web server, and this becomes a fixed cost.<\/p>\n<p>However, with &quot;Zero Scale WordPress,&quot; when there&#8217;s no access to the WordPress container (web server), the database server (a Google Compute Engine VM instance) is automatically stopped. When access resumes, it starts up instantly, allowing WordPress to operate normally.<\/p>\n<p>For example, based on estimates from May 2025, a database instance that would cost around $3.50\/month (T2D Spot instance $3.10 + standard persistent disk $0.40, excluding backup costs) even if running continuously, could potentially be operated even more cheaply if successfully stopped using this mechanism. It&#8217;s truly a dream-like system that gets you closer to pay-as-you-go.<\/p>\n<p>Additionally, there are other benefits:<\/p>\n<ul>\n<li><strong>Efficient Resource Utilization<\/strong>: Since resources are only used when needed, it suppresses wasteful power consumption, making it gentle on your wallet and the environment!<\/li>\n<li><strong>High Scalability<\/strong>: Being based on Google Cloud Run, it can automatically scale to handle sudden increases in traffic.<\/li>\n<\/ul>\n<h2>How Is It Achieved? The Magic Behind &quot;Zero Scale&quot;<\/h2>\n<p>Here are the main technologies and mechanisms that realize this &quot;zero scale&quot;:<\/p>\n<h3>WordPress on Cloud Run<\/h3>\n<p>First, WordPress itself runs on Google Cloud&#8217;s serverless container execution environment, Cloud Run. This means that when there&#8217;s no access, the container count can go to zero, incurring no costs.<\/p>\n<h3>On-Demand Database Startup (Startup Probe)<\/h3>\n<p>This utilizes a Cloud Run feature called the &quot;Startup Probe.&quot;<\/p>\n<p>When the WordPress container starts, it first attempts to connect to the database (in this case, a MySQL server on Google Compute Engine).<br \/>\nIf it can&#8217;t connect (meaning the DB is stopped), a script automatically starts the Compute Engine instance!<br \/>\nOnce the DB successfully starts and connects, WordPress also begins to operate normally.<br \/>\nBy the way, we chose Compute Engine over Cloud SQL for a practical reason: instance startup was faster. While the same principle could work with Cloud SQL, startup times might be longer.<\/p>\n<h3>Automatic Database Shutdown (Monitoring &amp; Pub\/Sub &amp; Cloud Functions)<\/h3>\n<p>Google Cloud Monitoring detects when the number of Cloud Run container instances becomes zero (meaning there&#8217;s no more access).<br \/>\nAfter a certain period of no access (e.g., 10 minutes), a notification is sent to a messaging service called Pub\/Sub.<br \/>\nThis notification triggers a small function prepared in Cloud Functions, which then automatically stops the Compute Engine instance (MySQL server).<\/p>\n<h3>Data is Securely Persisted<\/h3>\n<p>WordPress post data and settings are saved on the Compute Engine&#8217;s persistent disk.<br \/>\nUploaded files like images (<code>wp-content\/uploads<\/code>) are stored in Cloud Storage and mounted by Cloud Run, so data is safe even when the container stops.<\/p>\n<h3>Modern Configuration Management<\/h3>\n<p>WordPress core version control, as well as theme and plugin management, is handled using Composer, realizing a modern and efficient development and operational flow.<br \/>\nBy linking these mechanisms, the ideal WordPress environment\u2014one that &quot;starts only when needed and stops when not&quot;\u2014is completed.<\/p>\n<p>Looking at the following architecture diagram should give you a better image of the overall flow.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/docs.google.com\/presentation\/d\/e\/2PACX-1vSclnELGPyob6uy68TSG6QaRyVghZMtIGuWk627I4Dx4M4fv5G7iIoKxyyOrQ9ChECaztjRlE7h5C5x\/pubembed?start=false&#038;loop=false&#038;delayms=3000\" frameborder=\"0\" width=\"480\" height=\"299\" allowfullscreen=\"true\" mozallowfullscreen=\"true\" webkitallowfullscreen=\"true\"><\/iframe><\/p>\n<h2>Experience &quot;Zero Scale WordPress&quot;!<\/h2>\n<p>If you&#8217;re thinking, &quot;I want to try this myself!&quot; that&#8217;s fantastic. All the detailed configuration files and scripts to realize this &quot;Zero Scale WordPress&quot; are publicly available in the following GitHub repository:<\/p>\n<p><a href=\"https:\/\/github.com\/takotakot\/zeroscale-wp\">Zero Scale WordPress &#8211; GitHub Repository<\/a> <a href=\"https:\/\/github.com\/takotakot\/zeroscale-wp\">https:\/\/github.com\/takotakot\/zeroscale-wp<\/a><\/p>\n<p>The <code>README.md<\/code> file in the repository contains even more detailed technical information.<\/p>\n<p>What you&#8217;ll need (roughly):<\/p>\n<ul>\n<li>A Google Cloud account<\/li>\n<li>Basic knowledge of Docker and containers<\/li>\n<li>The <code>gcloud<\/code> command-line tool<\/li>\n<\/ul>\n<p>Main configuration points:<\/p>\n<ul>\n<li><strong>Cloud Storage Bucket Configuration<\/strong>: Preparing buckets to store WordPress core files, themes, plugins, and uploaded files.<\/li>\n<li><strong>Cloud Build Configuration<\/strong>: Setting up <code>cloudbuild.yaml<\/code> to automate Docker image building and deployment.<\/li>\n<li><strong>Cloud Run Configuration<\/strong>: Setting environment variables (like database connection info) and the aforementioned Startup Probe (<code>startup_gce.php<\/code>).<\/li>\n<li><strong>Cloud Functions Configuration<\/strong>: Deploying the function that stops the Compute Engine instance.<\/li>\n<\/ul>\n<p>Setup requires a certain level of technical knowledge, but this mechanism, with its potential for dramatic cost reduction, is well worth the challenge.<\/p>\n<h2>Conclusion: A New Form of WordPress Operation<\/h2>\n<p>&quot;Zero Scale WordPress&quot; proposes a new style of WordPress operation that overturns conventional wisdom.<\/p>\n<ul>\n<li>Overwhelming cost benefits<\/li>\n<li>Efficient use of resources<\/li>\n<li>Utilization of serverless technology<\/li>\n<\/ul>\n<p>From personal blogs to small-scale business sites, this project could be a great boon for many WordPress users.<\/p>\n<p>Please check out the GitHub repository and experience the future of WordPress operation. And if you do try it, we&#8217;d be delighted if you could provide feedback, impressions, or suggestions for improvement via comments or GitHub Issues!<\/p>\n<p>May your WordPress life become more comfortable and economical!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zero Scale WordPress \u6982\u8981 \u3010\u30b3\u30b9\u30c8\u524a\u6e1b\u3011WordPress\u3092\u8ce2\u304f\u904b\u7528\uff01Cloud Run\u3067\u5b9f\u73fe\u3059\u308b\u7a76\u6975\u306e\u30bc\u30ed\u30b9\u30b1\u30fc\u30eb\u8853 WordPress \u30b5\u30a4\u30c8\u3001\u30a2\u30af\u30bb\u30b9\u304c\u306a\u3044\u6642\u3082\u30b5\u30fc\u30d0\u30fc\u4ee3\u304c\u304b\u304b\u3063\u3066\u3044\u307e\u305b\u3093\u304b\uff1f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[26,13,8],"tags":[],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-cloud-run","category-google-cloud","category-wordpress"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4dIdP-9p","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":2,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":585,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/585"}],"wp:attachment":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/tags?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}