{"id":607,"date":"2025-08-11T15:42:40","date_gmt":"2025-08-11T06:42:40","guid":{"rendered":"https:\/\/tako.nakano.net\/blog\/?p=607"},"modified":"2025-08-11T15:42:40","modified_gmt":"2025-08-11T06:42:40","slug":"cloud-run-sqlite-performance-part-2","status":"publish","type":"post","link":"https:\/\/tako.nakano.net\/blog\/2025\/08\/cloud-run-sqlite-performance-part-2\/","title":{"rendered":"Cloud Run SQLite Persistence: GCS Mount vs. Litestream Performance Comparison (Part 2)"},"content":{"rendered":"<h1>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8\u3068 Litestream \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\uff082\u56de\u76ee\uff09<\/h1>\n<p>English follows Japanese.<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>Cloud Run \u4e0a\u3067\u52d5\u304f Rails 8 \u304b\u3089 SQLite \u3092\u5229\u7528\u3059\u308b\u969b\u3001\u66f8\u304d\u8fbc\u307f\u6027\u80fd\u306b\u304a\u3044\u3066\u306f Litestream \u304c Google Cloud Storage \u30de\u30a6\u30f3\u30c8 (GCS fuse) \u3092\u4e0a\u56de\u308b\uff08\u7d041.7\u500d\uff09\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u66f8\u304d\u8fbc\u307f\u51e6\u7406\u3092\u4f34\u3046\u5834\u5408\u3001GCS fuse \u306e\u5229\u7528\u306f\u614e\u91cd\u306b\u691c\u8a0e\u3059\u3079\u304d\u3067\u3042\u308a\u3001Litestream \u304c\u6709\u529b\u306a\u9078\u629e\u80a2\u3068\u306a\u308b\u3002<\/p>\n<p>\u3053\u306e2\u56de\u76ee\u3067\u4e00\u9023\u306e\u8a18\u4e8b\u306f\u7d42\u308f\u308a\u3067\u3042\u308b\u3002<\/p>\n<h2>\u672c\u8a18\u4e8b\u306e\u69cb\u6210<\/h2>\n<ul>\n<li>\u7d50\u8ad6<\/li>\n<li>\u672c\u8a18\u4e8b\u306e\u69cb\u6210<\/li>\n<li>\u53c2\u8003\u6587\u732e<\/li>\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\n<ul>\n<li>\u4ed5\u69d8<\/li>\n<li>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8 (GCS fuse)<\/li>\n<li>Litestream<\/li>\n<\/ul>\n<\/li>\n<li>\u8003\u5bdf<\/li>\n<li>\u751f\u30c7\u30fc\u30bf (RAW Data)\n<ul>\n<li>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8 (GCS fuse)<\/li>\n<li>Litestream<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u53c2\u8003\u6587\u732e<\/h2>\n<ul>\n<li>\u524d\u56de\u8a18\u4e8b<a href=\"https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/\">Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8\u3068 Litestream \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\uff081\u56de\u76ee\uff09<\/a> <a href=\"https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/\">https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/<\/a><\/li>\n<\/ul>\n<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u524d\u56de\u306f\u3001Rails 8 \u306b\u304a\u3044\u3066 SQLite \u3092\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b\u6301\u3064\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3001Cloud Run \u4e0a\u3067\u52d5\u304b\u3057\u3001Google Cloud Storage \u30de\u30a6\u30f3\u30c8 (GCS fuse) \u3068 Litestream \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\u3092\u5927\u96d1\u628a\u306b\u884c\u3063\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30011 vCPU \u3067\u3069\u306e\u304f\u3089\u3044\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u51fa\u308b\u306e\u304b\u3001\u3082\u3046\u5c11\u3057\u8a73\u7d30\u306b\u691c\u8a3c\u3059\u308b\u3002<\/p>\n<h2>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03<\/h2>\n<h3>\u4ed5\u69d8<\/h3>\n<p>\u524d\u56de\u3068\u540c\u69d8\u3001\u8a08\u6e2c\u3055\u308c\u308b\u5074\u306e Ruby on Rails \u306e\u52d5\u4f5c\u306f\u4ee5\u4e0b\u3067\u3042\u308b\u3002<\/p>\n<ul>\n<li><code>id, count<\/code> \u306e2\u30ab\u30e9\u30e0\u3092\u6301\u3064 <code>counters<\/code> \u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210<\/li>\n<li><code>seeds.rb<\/code> \u3067 <code>id = &#039;count_up&#039;, count = 0<\/code> \u306e\u30ec\u30b3\u30fc\u30c9\u30921\u4ef6\u4f5c\u6210<\/li>\n<li><code>\/count_up<\/code> \u3078\u306e POST \u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u306b\u3001<code>id = &#039;count_up&#039;<\/code> \u306e\u30ec\u30b3\u30fc\u30c9\u306e <code>count<\/code> \u30921\u5897\u3084\u3059(<code>update_all(&quot;count = count + 1&quot;)<\/code>)<\/li>\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u306f\u3001<code>count<\/code> \u306e\u5024\u3092 <code>{&quot;count&quot;:4856}<\/code> \u306e\u5f62\u5f0f\u3067\u8fd4\u3059<\/li>\n<li><code>\/count_up<\/code> \u3078\u306e POST \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u591a\u6570\u56de\u5b9f\u884c\u3057\u3001Request per second (RPS) \u3092\u8a08\u6e2c<\/li>\n<\/ul>\n<p>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8a08\u6e2c\u306b\u306f k6 \u3092\u7528\u3044\u305f\u3002<br \/>\n\u4eca\u56de\u306f\u3001\u8a08\u6e2c\u8aa4\u5dee\u304c\u5c11\u306a\u304f\u306a\u308b\u3088\u3046\u3001\u30b7\u30ca\u30ea\u30aa\u306b\u5909\u5316\u3092\u52a0\u3048\u305f\u3002<\/p>\n<pre><code class=\"language-javascript\">import http from &#039;k6\/http&#039;;\nimport { check } from &#039;k6&#039;;\n\nexport const options = {\n  vus: 2,\n  duration: &#039;120s&#039;,\n};\n\nexport default function() {\n  const res = http.post(&#039;https:\/\/ URL .asia-northeast1.run.app\/count_up&#039;);\n  check(res, { &quot;status is 200&quot;: (res) =&gt; res.status === 200 });\n}<\/code><\/pre>\n<p>\u30b3\u30f3\u30c6\u30ca\u306e\u540c\u6642\u30ea\u30af\u30a8\u30b9\u30c8\u53d7\u3051\u4ed8\u3051\u6570\u3092 2 \u304b\u3089 2 \u523b\u307f\u306b 20 \u307e\u3067\u5909\u5316\u3055\u305b\u305f\u30023\u56de\u8a08\u6e2c\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u6307\u6a19\u306b\u3064\u3044\u3066\u30013\u56de\u306e\u3046\u3061\u306e\u4e2d\u592e\u5024\u3092\u63a1\u7528\u3057\u305f\u3002<\/p>\n<p>\u53d6\u5f97\u3057\u305f\u6307\u6a19\u306f\u3001med, avg, p(90), p(95), min, max \u3067\u3042\u308b\u3002<\/p>\n<p>Cloud Run \u306e\u30b3\u30f3\u30c6\u30ca\u306b\u306f\u30011 vCPU \u3068 1 GiB \u306e\u30e1\u30e2\u30ea\u3092\u5272\u308a\u5f53\u3066\u305f\u3002<\/p>\n<h3>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8 (GCS fuse)<\/h3>\n<p>CPU utilization \u306f\u307b\u307c 100 % \u3067\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306f 12 % \u672a\u6e80\u3060\u3063\u305f\u3002<\/p>\n<p>\u5358\u4f4d\u306f ms \u3067\u3042\u308b\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u540c\u6642\u30ea\u30af\u30a8\u30b9\u30c8\u6570(vus)<\/th>\n<th>med<\/th>\n<th>avg<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<th>min<\/th>\n<th>max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>10.97<\/td>\n<td>16.79<\/td>\n<td>38.74<\/td>\n<td>42.62<\/td>\n<td>8.12<\/td>\n<td>629.35<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>18.29<\/td>\n<td>32.11<\/td>\n<td>61.5<\/td>\n<td>64.07<\/td>\n<td>7.81<\/td>\n<td>668.82<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>33.77<\/td>\n<td>49.3<\/td>\n<td>72.43<\/td>\n<td>74.95<\/td>\n<td>8.92<\/td>\n<td>685.2<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>73.2<\/td>\n<td>65.71<\/td>\n<td>83.05<\/td>\n<td>86.15<\/td>\n<td>8.59<\/td>\n<td>676.23<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>85.03<\/td>\n<td>83.1<\/td>\n<td>94.14<\/td>\n<td>97.75<\/td>\n<td>8.99<\/td>\n<td>722.75<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>94.21<\/td>\n<td>98.2<\/td>\n<td>104.83<\/td>\n<td>112.09<\/td>\n<td>8.59<\/td>\n<td>748.89<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>103.31<\/td>\n<td>114.14<\/td>\n<td>125.39<\/td>\n<td>149.31<\/td>\n<td>7.91<\/td>\n<td>769.1<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>114.58<\/td>\n<td>130.89<\/td>\n<td>158.2<\/td>\n<td>164.81<\/td>\n<td>7.97<\/td>\n<td>754.52<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>126.01<\/td>\n<td>146.7<\/td>\n<td>170.05<\/td>\n<td>176.23<\/td>\n<td>8.19<\/td>\n<td>783.91<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>164.94<\/td>\n<td>165.12<\/td>\n<td>184.68<\/td>\n<td>192<\/td>\n<td>8.32<\/td>\n<td>783.74<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Litestream<\/h3>\n<p>CPU utilization \u306f\u307b\u307c 100 % \u3067\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306f 20 % \u524d\u5f8c\u3060\u3063\u305f\u3002<\/p>\n<p>\u5358\u4f4d\u306f ms \u3067\u3042\u308b\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u540c\u6642\u30ea\u30af\u30a8\u30b9\u30c8\u6570(vus)<\/th>\n<th>med<\/th>\n<th>avg<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<th>min<\/th>\n<th>max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>8.81<\/td>\n<td>10.14<\/td>\n<td>12.61<\/td>\n<td>18.49<\/td>\n<td>6.37<\/td>\n<td>101.62<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>11.14<\/td>\n<td>19.51<\/td>\n<td>52.09<\/td>\n<td>55.21<\/td>\n<td>6.41<\/td>\n<td>159.78<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>17.07<\/td>\n<td>28.63<\/td>\n<td>60.03<\/td>\n<td>62.92<\/td>\n<td>6.59<\/td>\n<td>169.82<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>25.45<\/td>\n<td>38.87<\/td>\n<td>66.63<\/td>\n<td>70.48<\/td>\n<td>6.48<\/td>\n<td>247.1<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>34.03<\/td>\n<td>47.36<\/td>\n<td>73.08<\/td>\n<td>77.27<\/td>\n<td>6.7<\/td>\n<td>200.26<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>68.5<\/td>\n<td>56.35<\/td>\n<td>79.55<\/td>\n<td>84.1<\/td>\n<td>6.49<\/td>\n<td>183.35<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>76.94<\/td>\n<td>67.46<\/td>\n<td>88.02<\/td>\n<td>93.16<\/td>\n<td>6.51<\/td>\n<td>219.32<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>83.6<\/td>\n<td>77<\/td>\n<td>94.66<\/td>\n<td>99.93<\/td>\n<td>6.63<\/td>\n<td>189.46<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>89.72<\/td>\n<td>85.77<\/td>\n<td>101.19<\/td>\n<td>107.72<\/td>\n<td>6.39<\/td>\n<td>215.69<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>95.24<\/td>\n<td>94.59<\/td>\n<td>106.96<\/td>\n<td>115.95<\/td>\n<td>6.34<\/td>\n<td>215.97<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u8003\u5bdf<\/h2>\n<p>\u5168\u4f53\u7684\u306a\u30ec\u30a4\u30c6\u30f3\u30b7\u306f\u3001Litestream \u306e\u65b9\u304c\u4f4e\u304f\u3001Cloud Storage \u306b\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u304c\u9ad8\u3044\u305f\u3081\u3060\u3068\u60f3\u5b9a\u3055\u308c\u308b\u3002<\/p>\n<p>min \u30ec\u30a4\u30c6\u30f3\u30b7\u3092\u5168\u4f53\u7684\u306b\u898b\u305f\u3068\u304d\u306b\u3001\u307b\u307c\u5909\u308f\u3089\u306a\u3044\u306e\u306f\u3001\u6700\u521d\u306e\u6570\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u65e9\u304f\u5fdc\u7b54\u3057\u3066\u3044\u308b\u305f\u3081\u3068\u8003\u3048\u3089\u308c\u308b\u3002Litestream \u3068 Cloud Storage \u30de\u30a6\u30f3\u30c8\u306e\u5dee\u306f\u7d04 2 ms \u3067\u3001\u3053\u308c\u304c Cloud Storage \u3078\u306e\u66f8\u304d\u8fbc\u307f\u306e\u6700\u77ed\u30ec\u30a4\u30c6\u30f3\u30b7\u3068\u8003\u3048\u3089\u308c\u308b\u3002Litestream \u306f\u3001\u30ed\u30fc\u30ab\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u3092\u5b8c\u4e86\u3057\u305f\u6642\u70b9\u3067\u6b21\u306e\u51e6\u7406\u306b\u9032\u307f\u3001\u8ee2\u9001\u306f\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u975e\u540c\u671f\u306b\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3055\u308c\u308b\u305f\u3081\u3001\u66f8\u304d\u8fbc\u307f\u306e\u5f85\u3061\u6642\u9593\u304c\u767a\u751f\u3057\u306a\u3044\u3068\u8003\u3048\u3089\u308c\u308b\u3002<\/p>\n<p>avg \uff08\u76f8\u52a0\u5e73\u5747\uff09\u306f\u3069\u3061\u3089\u3082\u307b\u307c\u7dda\u5f62\u306b\u5897\u52a0\u3057\u3066\u3044\u308b\u3002\uff08\u751f\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\uff09y\u5207\u7247\u30920\u3068\u3057\u305f\u3068\u304d\u306e\u4fc2\u6570\u306f\u30018.19 \u3068 4.77 \u3067\u3042\u308b\u3002\u7d041.7\u500d\u306e\u5dee\u304c\u3042\u308b\u3002\u3053\u308c\u304c\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5dee\u307b\u307c\u305d\u306e\u3082\u306e\u3068\u8a00\u3063\u3066\u826f\u3044\u3060\u308d\u3046\u304b\uff1f<\/p>\n<p>\u4e2d\u592e\u5024 (med) \u3068\u5e73\u5747\u5024 (avg) \u306e\u5dee\u5206\u306b\u3064\u3044\u3066\u306f\u8003\u5bdf\u304c\u96e3\u3057\u3044\u3002Litestream \u306b\u3064\u3044\u3066\u306f\u3001vus = 12 \u3067 med \u304c\u5c0f\u3055\u304b\u3063\u305f\u3068\u3053\u308d\u304b\u3089\u5927\u304d\u304f\u306a\u308b\u5074\u306b\u9006\u8ee2\u3057\u3066\u3044\u308b\u304c\u3001\u305d\u306e\u5f8c\u306f med, avg \u304c\u8fd1\u3065\u3044\u3066\u3044\u308b\u3002Cloud Storage \u306b\u3064\u3044\u3066\u306f\u3001\u5927\u4f53\u306e\u5834\u5408 med \u306e\u65b9\u304c\u82e5\u5e72\u5c0f\u3055\u304f\u3001\u30ed\u30f3\u30b0\u30c6\u30fc\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3060\u3068\u8003\u3048\u308b\u3068\u3001\u59a5\u5f53\u306a\u7d50\u679c\u3067\u3042\u308b\u3002<\/p>\n<p>\u3069\u3061\u3089\u3082\u3001\u7d14\u7c8b\u306b CPU \u3068\u66f8\u304d\u8fbc\u307f\u306e\u5f85\u3061\u6642\u9593\u304c\u51e6\u7406\u306b\u5f71\u97ff\u3057\u3066\u304a\u308a\u3001\u7279\u5225\u306a\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306f\u306a\u3044\u3068\u8003\u3048\u3066\u826f\u3055\u305d\u3046\u3060\u3002<\/p>\n<h2>\u751f\u30c7\u30fc\u30bf (RAW Data)<\/h2>\n<h3>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8<\/h3>\n<table>\n<thead>\n<tr>\n<th>vus<\/th>\n<th>times<\/th>\n<th>avg<\/th>\n<th>min<\/th>\n<th>med<\/th>\n<th>max<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>1<\/td>\n<td>16.48<\/td>\n<td>8.03<\/td>\n<td>10.91<\/td>\n<td>629.35<\/td>\n<td>37.57<\/td>\n<td>41.74<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<td>16.79<\/td>\n<td>8.12<\/td>\n<td>10.97<\/td>\n<td>612.11<\/td>\n<td>39.12<\/td>\n<td>42.77<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>3<\/td>\n<td>17.33<\/td>\n<td>8.12<\/td>\n<td>11.48<\/td>\n<td>656.12<\/td>\n<td>38.74<\/td>\n<td>42.62<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1<\/td>\n<td>30.33<\/td>\n<td>7.71<\/td>\n<td>16.65<\/td>\n<td>682.63<\/td>\n<td>61.2<\/td>\n<td>63.57<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>2<\/td>\n<td>33.09<\/td>\n<td>9.27<\/td>\n<td>19.05<\/td>\n<td>668.82<\/td>\n<td>61.71<\/td>\n<td>64.13<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>3<\/td>\n<td>32.11<\/td>\n<td>7.81<\/td>\n<td>18.29<\/td>\n<td>662.95<\/td>\n<td>61.5<\/td>\n<td>64.07<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1<\/td>\n<td>43.55<\/td>\n<td>8.02<\/td>\n<td>24.58<\/td>\n<td>647.82<\/td>\n<td>70.24<\/td>\n<td>72.28<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>2<\/td>\n<td>49.3<\/td>\n<td>8.92<\/td>\n<td>33.77<\/td>\n<td>740.19<\/td>\n<td>72.43<\/td>\n<td>74.95<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>3<\/td>\n<td>50.85<\/td>\n<td>9.09<\/td>\n<td>37.48<\/td>\n<td>685.2<\/td>\n<td>72.88<\/td>\n<td>76.34<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1<\/td>\n<td>57.98<\/td>\n<td>7.48<\/td>\n<td>69.09<\/td>\n<td>663.83<\/td>\n<td>79.15<\/td>\n<td>82.02<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>2<\/td>\n<td>65.71<\/td>\n<td>8.59<\/td>\n<td>73.2<\/td>\n<td>676.23<\/td>\n<td>83.05<\/td>\n<td>86.15<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>3<\/td>\n<td>67.88<\/td>\n<td>9.82<\/td>\n<td>73.71<\/td>\n<td>714.94<\/td>\n<td>83.58<\/td>\n<td>87.24<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>1<\/td>\n<td>76.49<\/td>\n<td>8.99<\/td>\n<td>81.41<\/td>\n<td>712.88<\/td>\n<td>90.51<\/td>\n<td>94.24<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>2<\/td>\n<td>83.1<\/td>\n<td>8.97<\/td>\n<td>85.03<\/td>\n<td>722.75<\/td>\n<td>94.14<\/td>\n<td>97.75<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>3<\/td>\n<td>89.4<\/td>\n<td>9.37<\/td>\n<td>87.47<\/td>\n<td>803.19<\/td>\n<td>98.5<\/td>\n<td>103.99<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>1<\/td>\n<td>89.2<\/td>\n<td>8.59<\/td>\n<td>89.29<\/td>\n<td>684.38<\/td>\n<td>97.77<\/td>\n<td>102.06<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>2<\/td>\n<td>98.2<\/td>\n<td>7.94<\/td>\n<td>94.21<\/td>\n<td>748.89<\/td>\n<td>104.83<\/td>\n<td>112.09<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>3<\/td>\n<td>100.97<\/td>\n<td>9.29<\/td>\n<td>95.63<\/td>\n<td>750.84<\/td>\n<td>106.47<\/td>\n<td>114.56<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>1<\/td>\n<td>105.06<\/td>\n<td>7.45<\/td>\n<td>98.19<\/td>\n<td>751.74<\/td>\n<td>107.53<\/td>\n<td>119.47<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>2<\/td>\n<td>114.14<\/td>\n<td>7.91<\/td>\n<td>103.31<\/td>\n<td>769.1<\/td>\n<td>125.39<\/td>\n<td>149.31<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>3<\/td>\n<td>118.85<\/td>\n<td>8.94<\/td>\n<td>105.81<\/td>\n<td>779.73<\/td>\n<td>145.42<\/td>\n<td>153.72<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>1<\/td>\n<td>121.4<\/td>\n<td>7.9<\/td>\n<td>108.29<\/td>\n<td>731.85<\/td>\n<td>152.49<\/td>\n<td>157.6<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>2<\/td>\n<td>130.89<\/td>\n<td>8.67<\/td>\n<td>114.58<\/td>\n<td>754.52<\/td>\n<td>158.2<\/td>\n<td>164.81<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>3<\/td>\n<td>134.9<\/td>\n<td>7.97<\/td>\n<td>118.14<\/td>\n<td>832.44<\/td>\n<td>160.62<\/td>\n<td>166.12<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>1<\/td>\n<td>139.57<\/td>\n<td>8.06<\/td>\n<td>120.03<\/td>\n<td>754.14<\/td>\n<td>166.18<\/td>\n<td>171.32<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>2<\/td>\n<td>146.7<\/td>\n<td>8.19<\/td>\n<td>126.01<\/td>\n<td>817.21<\/td>\n<td>170.05<\/td>\n<td>176.23<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>3<\/td>\n<td>157.86<\/td>\n<td>9.2<\/td>\n<td>147.54<\/td>\n<td>783.91<\/td>\n<td>176.8<\/td>\n<td>182.67<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>1<\/td>\n<td>160.13<\/td>\n<td>8.1<\/td>\n<td>157.38<\/td>\n<td>773.16<\/td>\n<td>180.01<\/td>\n<td>185.73<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>2<\/td>\n<td>165.12<\/td>\n<td>8.32<\/td>\n<td>164.94<\/td>\n<td>868.16<\/td>\n<td>184.68<\/td>\n<td>192<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>3<\/td>\n<td>179.59<\/td>\n<td>9.37<\/td>\n<td>176.5<\/td>\n<td>783.74<\/td>\n<td>193.79<\/td>\n<td>200.92<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Litestream<\/h3>\n<table>\n<thead>\n<tr>\n<th>vus<\/th>\n<th>times<\/th>\n<th>avg<\/th>\n<th>min<\/th>\n<th>med<\/th>\n<th>max<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>1<\/td>\n<td>10.25<\/td>\n<td>6.96<\/td>\n<td>9.24<\/td>\n<td>101.62<\/td>\n<td>12.18<\/td>\n<td>16.5<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<td>10.14<\/td>\n<td>5.79<\/td>\n<td>8.81<\/td>\n<td>109.79<\/td>\n<td>13.55<\/td>\n<td>19.96<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>3<\/td>\n<td>10.01<\/td>\n<td>6.37<\/td>\n<td>8.79<\/td>\n<td>99.16<\/td>\n<td>12.61<\/td>\n<td>18.49<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1<\/td>\n<td>19.51<\/td>\n<td>6.34<\/td>\n<td>10.01<\/td>\n<td>181.36<\/td>\n<td>57.23<\/td>\n<td>60.88<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>2<\/td>\n<td>19.59<\/td>\n<td>6.41<\/td>\n<td>11.63<\/td>\n<td>115.63<\/td>\n<td>52.07<\/td>\n<td>55.21<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>3<\/td>\n<td>19.12<\/td>\n<td>6.72<\/td>\n<td>11.14<\/td>\n<td>159.78<\/td>\n<td>52.09<\/td>\n<td>55.02<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1<\/td>\n<td>29.51<\/td>\n<td>6.59<\/td>\n<td>11.55<\/td>\n<td>279.96<\/td>\n<td>73.59<\/td>\n<td>78.47<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>2<\/td>\n<td>28.56<\/td>\n<td>6.19<\/td>\n<td>17.07<\/td>\n<td>157.23<\/td>\n<td>59.91<\/td>\n<td>62.92<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>3<\/td>\n<td>28.63<\/td>\n<td>7.22<\/td>\n<td>17.16<\/td>\n<td>169.82<\/td>\n<td>60.03<\/td>\n<td>62.77<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1<\/td>\n<td>38.87<\/td>\n<td>6.27<\/td>\n<td>20.34<\/td>\n<td>291.79<\/td>\n<td>84.77<\/td>\n<td>96.16<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>2<\/td>\n<td>39.1<\/td>\n<td>6.86<\/td>\n<td>25.54<\/td>\n<td>247.1<\/td>\n<td>66.63<\/td>\n<td>70.48<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>3<\/td>\n<td>38.63<\/td>\n<td>6.48<\/td>\n<td>25.45<\/td>\n<td>169.77<\/td>\n<td>66.5<\/td>\n<td>70.08<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>1<\/td>\n<td>47.36<\/td>\n<td>6.67<\/td>\n<td>34.03<\/td>\n<td>214.77<\/td>\n<td>73.08<\/td>\n<td>76.84<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>2<\/td>\n<td>46.98<\/td>\n<td>6.78<\/td>\n<td>32.54<\/td>\n<td>181.13<\/td>\n<td>72.96<\/td>\n<td>77.83<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>3<\/td>\n<td>47.55<\/td>\n<td>6.7<\/td>\n<td>34.44<\/td>\n<td>200.26<\/td>\n<td>73.16<\/td>\n<td>77.27<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>1<\/td>\n<td>56.22<\/td>\n<td>6.62<\/td>\n<td>68.66<\/td>\n<td>165.73<\/td>\n<td>79.71<\/td>\n<td>84.11<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>2<\/td>\n<td>56.35<\/td>\n<td>6.39<\/td>\n<td>68.17<\/td>\n<td>183.35<\/td>\n<td>79.55<\/td>\n<td>84.1<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>3<\/td>\n<td>56.36<\/td>\n<td>6.49<\/td>\n<td>68.5<\/td>\n<td>211.98<\/td>\n<td>79.55<\/td>\n<td>83.65<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>1<\/td>\n<td>67.46<\/td>\n<td>6.51<\/td>\n<td>77.03<\/td>\n<td>219.32<\/td>\n<td>88.02<\/td>\n<td>93.16<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>2<\/td>\n<td>67.63<\/td>\n<td>6.32<\/td>\n<td>76.94<\/td>\n<td>184.46<\/td>\n<td>88.24<\/td>\n<td>93.2<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>3<\/td>\n<td>65.57<\/td>\n<td>6.65<\/td>\n<td>76.06<\/td>\n<td>219.89<\/td>\n<td>86.27<\/td>\n<td>91.41<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>1<\/td>\n<td>78.08<\/td>\n<td>6.62<\/td>\n<td>83.94<\/td>\n<td>199.29<\/td>\n<td>96.59<\/td>\n<td>102.79<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>2<\/td>\n<td>77<\/td>\n<td>6.63<\/td>\n<td>83.6<\/td>\n<td>189.46<\/td>\n<td>94.66<\/td>\n<td>99.93<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>3<\/td>\n<td>75.83<\/td>\n<td>6.63<\/td>\n<td>83.12<\/td>\n<td>180.24<\/td>\n<td>93.34<\/td>\n<td>98.1<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>1<\/td>\n<td>87.82<\/td>\n<td>6.19<\/td>\n<td>90.41<\/td>\n<td>215.69<\/td>\n<td>103.28<\/td>\n<td>112.25<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>2<\/td>\n<td>85.57<\/td>\n<td>6.73<\/td>\n<td>89.72<\/td>\n<td>215.08<\/td>\n<td>100.48<\/td>\n<td>106.3<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>3<\/td>\n<td>85.77<\/td>\n<td>6.39<\/td>\n<td>89.34<\/td>\n<td>318.6<\/td>\n<td>101.19<\/td>\n<td>107.72<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>1<\/td>\n<td>95.66<\/td>\n<td>6.63<\/td>\n<td>95.66<\/td>\n<td>213.93<\/td>\n<td>109.17<\/td>\n<td>134.28<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>2<\/td>\n<td>93.08<\/td>\n<td>6.09<\/td>\n<td>94.51<\/td>\n<td>215.97<\/td>\n<td>105.93<\/td>\n<td>114.93<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>3<\/td>\n<td>94.59<\/td>\n<td>6.34<\/td>\n<td>95.24<\/td>\n<td>250.34<\/td>\n<td>106.96<\/td>\n<td>115.95<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h1>Cloud Run SQLite Persistence: GCS Mount vs. Litestream Performance Comparison (Part 2)<\/h1>\n<h2>Conclusion<\/h2>\n<p>When using SQLite with Rails 8 on Cloud Run, we found that for write performance, <strong>Litestream outperforms Google Cloud Storage mount (GCS fuse) by about 1.7 times<\/strong>.<\/p>\n<p>If your application involves write operations, using GCS fuse should be carefully considered, making Litestream a strong alternative.<\/p>\n<p>This is the end of the series of articles.<\/p>\n<h2>Table of Contents<\/h2>\n<ul>\n<li>Conclusion<\/li>\n<li>Table of Contents<\/li>\n<li>References<\/li>\n<li>Introduction<\/li>\n<li>Performance Comparison\n<ul>\n<li>Specifications<\/li>\n<li>Cloud Run Google Cloud Storage Mount (GCS fuse)<\/li>\n<li>Litestream<\/li>\n<\/ul>\n<\/li>\n<li>Analysis<\/li>\n<li>Raw Data (See the Japanese part)<\/li>\n<\/ul>\n<h2>References<\/h2>\n<ul>\n<li>Previous Article: <a href=\"https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/\">Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8\u3068 Litestream \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\uff081\u56de\u76ee\uff09<\/a> <a href=\"https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/\">https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-sqlite-performance-part-1\/<\/a><\/li>\n<\/ul>\n<h2>Introduction<\/h2>\n<p>In the previous article, we performed a rough performance comparison between Google Cloud Storage mount (GCS fuse) and Litestream for a Rails 8 application with a SQLite backend running on Cloud Run.<\/p>\n<p>This time, we will conduct a more detailed investigation to see how much performance can be achieved with 1 vCPU.<\/p>\n<h2>Performance Comparison<\/h2>\n<h3>Specifications<\/h3>\n<p>As before, the behavior of the Ruby on Rails application being measured is as follows:<\/p>\n<ul>\n<li>A <code>counters<\/code> table is created with two columns: <code>id<\/code> and <code>count<\/code>.<\/li>\n<li><code>seeds.rb<\/code> creates one record: <code>id = &#039;count_up&#039;, count = 0<\/code>.<\/li>\n<li>For each POST request to <code>\/count_up<\/code>, the <code>count<\/code> of the <code>id = &#039;count_up&#039;<\/code> record is incremented by 1 (<code>update_all(&quot;count = count + 1&quot;)<\/code>).<\/li>\n<li>The response returns the value of <code>count<\/code> in the format <code>{&quot;count&quot;:4856}<\/code>.<\/li>\n<li>We execute numerous POST requests to <code>\/count_up<\/code> to measure Requests Per Second (RPS).<\/li>\n<\/ul>\n<p>We used k6 for performance measurement.<br \/>\nThis time, we modified the scenario to reduce measurement errors.<\/p>\n<pre><code class=\"language-javascript\">import http from &#039;k6\/http&#039;;\nimport { check } from &#039;k6&#039;;\n\nexport const options = {\n  vus: 2,\n  duration: &#039;120s&#039;,\n};\n\nexport default function() {\n  const res = http.post(&#039;https:\/\/ URL .asia-northeast1.run.app\/count_up&#039;);\n  check(res, { &quot;status is 200&quot;: (res) =&gt; res.status === 200 });\n}<\/code><\/pre>\n<p>We varied the number of concurrent requests the container accepts from 2 to 20, in increments of 2. We ran the measurement 3 times for each setting and used the median of the three runs for each metric.<\/p>\n<p>The metrics collected were: <code>med<\/code>, <code>avg<\/code>, <code>p(90)<\/code>, <code>p(95)<\/code>, <code>min<\/code>, and <code>max<\/code>.<\/p>\n<p>The Cloud Run container was allocated 1 vCPU and 1 GiB of memory.<\/p>\n<h3>Cloud Run Google Cloud Storage Mount (GCS fuse)<\/h3>\n<p>CPU utilization was nearly 100%, and memory usage was less than 12%.<\/p>\n<p>All units are in ms.<\/p>\n<table>\n<thead>\n<tr>\n<th>Concurrent Requests (vus)<\/th>\n<th>med<\/th>\n<th>avg<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<th>min<\/th>\n<th>max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>10.97<\/td>\n<td>16.79<\/td>\n<td>38.74<\/td>\n<td>42.62<\/td>\n<td>8.12<\/td>\n<td>629.35<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>18.29<\/td>\n<td>32.11<\/td>\n<td>61.5<\/td>\n<td>64.07<\/td>\n<td>7.81<\/td>\n<td>668.82<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>33.77<\/td>\n<td>49.3<\/td>\n<td>72.43<\/td>\n<td>74.95<\/td>\n<td>8.92<\/td>\n<td>685.2<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>73.2<\/td>\n<td>65.71<\/td>\n<td>83.05<\/td>\n<td>86.15<\/td>\n<td>8.59<\/td>\n<td>676.23<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>85.03<\/td>\n<td>83.1<\/td>\n<td>94.14<\/td>\n<td>97.75<\/td>\n<td>8.99<\/td>\n<td>722.75<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>94.21<\/td>\n<td>98.2<\/td>\n<td>104.83<\/td>\n<td>112.09<\/td>\n<td>8.59<\/td>\n<td>748.89<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>103.31<\/td>\n<td>114.14<\/td>\n<td>125.39<\/td>\n<td>149.31<\/td>\n<td>7.91<\/td>\n<td>769.1<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>114.58<\/td>\n<td>130.89<\/td>\n<td>158.2<\/td>\n<td>164.81<\/td>\n<td>7.97<\/td>\n<td>754.52<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>126.01<\/td>\n<td>146.7<\/td>\n<td>170.05<\/td>\n<td>176.23<\/td>\n<td>8.19<\/td>\n<td>783.91<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>164.94<\/td>\n<td>165.12<\/td>\n<td>184.68<\/td>\n<td>192<\/td>\n<td>8.32<\/td>\n<td>783.74<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Litestream<\/h3>\n<p>CPU utilization was nearly 100%, and memory usage was around 20%.<\/p>\n<p>All units are in ms.<\/p>\n<table>\n<thead>\n<tr>\n<th>Concurrent Requests (vus)<\/th>\n<th>med<\/th>\n<th>avg<\/th>\n<th>p(90)<\/th>\n<th>p(95)<\/th>\n<th>min<\/th>\n<th>max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>2<\/td>\n<td>8.81<\/td>\n<td>10.14<\/td>\n<td>12.61<\/td>\n<td>18.49<\/td>\n<td>6.37<\/td>\n<td>101.62<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>11.14<\/td>\n<td>19.51<\/td>\n<td>52.09<\/td>\n<td>55.21<\/td>\n<td>6.41<\/td>\n<td>159.78<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>17.07<\/td>\n<td>28.63<\/td>\n<td>60.03<\/td>\n<td>62.92<\/td>\n<td>6.59<\/td>\n<td>169.82<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>25.45<\/td>\n<td>38.87<\/td>\n<td>66.63<\/td>\n<td>70.48<\/td>\n<td>6.48<\/td>\n<td>247.1<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>34.03<\/td>\n<td>47.36<\/td>\n<td>73.08<\/td>\n<td>77.27<\/td>\n<td>6.7<\/td>\n<td>200.26<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>68.5<\/td>\n<td>56.35<\/td>\n<td>79.55<\/td>\n<td>84.1<\/td>\n<td>6.49<\/td>\n<td>183.35<\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>76.94<\/td>\n<td>67.46<\/td>\n<td>88.02<\/td>\n<td>93.16<\/td>\n<td>6.51<\/td>\n<td>219.32<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>83.6<\/td>\n<td>77<\/td>\n<td>94.66<\/td>\n<td>99.93<\/td>\n<td>6.63<\/td>\n<td>189.46<\/td>\n<\/tr>\n<tr>\n<td>18<\/td>\n<td>89.72<\/td>\n<td>85.77<\/td>\n<td>101.19<\/td>\n<td>107.72<\/td>\n<td>6.39<\/td>\n<td>215.69<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>95.24<\/td>\n<td>94.59<\/td>\n<td>106.96<\/td>\n<td>115.95<\/td>\n<td>6.34<\/td>\n<td>215.97<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Analysis<\/h2>\n<p>Overall latency is lower with Litestream, which is assumed to be due to the high latency of writing to Cloud Storage.<\/p>\n<p>When looking at the overall <code>min<\/code> latency, there is almost no difference. This is likely because the first few requests respond quickly. The difference between Litestream and the Cloud Storage mount is about 2 ms, which can be considered the minimum write latency to Cloud Storage. With Litestream, it is thought that there is no write latency because it proceeds to the next operation as soon as the write to the local file is complete, and the transfer is replicated asynchronously in the background.<\/p>\n<p>The <code>avg<\/code> (arithmetic mean) increases almost linearly for both. The coefficients, when the y-intercept is set to 0 (based on the raw data), are 8.19 and 4.77. This is a difference of about 1.7 times. Can we say this is essentially the performance difference?<\/p>\n<p>The difference between the median (<code>med<\/code>) and the average (<code>avg<\/code>) is difficult to analyze. For Litestream, at vus = 12, the <code>med<\/code> flips from being smaller than <code>avg<\/code> to being larger, but they converge afterward. For the Cloud Storage mount, the <code>med<\/code> is generally slightly smaller, which is a reasonable result considering it has a long tail.<\/p>\n<p>It seems safe to conclude that for both methods, the processing is purely affected by CPU and write latency, with no other specific bottlenecks.<\/p>\n<h2>Raw Data (See the Japanese part)<\/h2>\n<p>See the Japanese part above for the raw data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cloud Run \u306e Google Cloud Storage \u30de\u30a6\u30f3\u30c8\u3068 Litestream \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\uff082\u56de\u76ee\uff09 English follows Japanese. \u7d50\u8ad6 Cloud Run \u4e0a\u3067\u52d5\u304f  [&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,14],"tags":[],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","category-cloud-run","category-google-cloud","category-ruby"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4dIdP-9N","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/607","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=607"}],"version-history":[{"count":2,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"predecessor-version":[{"id":609,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions\/609"}],"wp:attachment":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}