Skip to content

Tune Cloud Run for SQLite - #69

Merged
legokichi merged 3 commits into
mainfrom
codex/cloudrun-sqlite-settings
Jun 11, 2026
Merged

Tune Cloud Run for SQLite#69
legokichi merged 3 commits into
mainfrom
codex/cloudrun-sqlite-settings

Conversation

@legokichi

@legokichi legokichi commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

  • raise Cloud Run request timeout from 3s to 60s
  • keep Cloud Run maxScale at 1 for the local SQLite + Litestream runtime
  • keep container concurrency at 128 and leave sqlx pool sizing to its defaults
  • remove timeout/concurrency from Terraform lifecycle ignores so Terraform manages them
  • remove redundant timeout/concurrency annotations and update stale comments

Validation

  • terraform fmt -recursive -check
  • terraform validate
  • cargo fmt --check
  • DATABASE_URL='sqlite://.local/cloudrun-sqlite-settings.db?mode=rwc' cargo test -p db connect_runs_migrations

@github-actions

Copy link
Copy Markdown

Terraform Plan Results

Terraform Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_cloud_run_service.litestream_sandbox will be updated in-place
  ~ resource "google_cloud_run_service" "litestream_sandbox" {
        id                         = "locations/asia-northeast1/namespaces/duxca-298210/services/litestream-sandbox"
        name                       = "litestream-sandbox"
        # (4 unchanged attributes hidden)

      ~ template {
          ~ metadata {
              ~ annotations      = {
                  + "autoscaling.knative.dev/minScale"         = "0"
                  - "run.googleapis.com/client-name"           = "gcloud" -> null
                  - "run.googleapis.com/client-version"        = "571.0.0" -> null
                  + "run.googleapis.com/cpu-boost"             = "false"
                  - "run.googleapis.com/startup-cpu-boost"     = "false" -> null
                    # (3 unchanged elements hidden)
                }
                name             = null
                # (6 unchanged attributes hidden)
            }
          ~ spec {
              ~ container_concurrency = 128 -> 4
              ~ timeout_seconds       = 3 -> 60
                # (3 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Pusher: @legokichi, Action: pull_request

@github-actions

Copy link
Copy Markdown

Terraform Plan Results

Terraform Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_cloud_run_service.litestream_sandbox will be updated in-place
  ~ resource "google_cloud_run_service" "litestream_sandbox" {
        id                         = "locations/asia-northeast1/namespaces/duxca-298210/services/litestream-sandbox"
        name                       = "litestream-sandbox"
        # (4 unchanged attributes hidden)

      ~ template {
          ~ metadata {
              ~ annotations      = {
                  + "autoscaling.knative.dev/minScale"         = "0"
                  - "run.googleapis.com/client-name"           = "gcloud" -> null
                  - "run.googleapis.com/client-version"        = "571.0.0" -> null
                  + "run.googleapis.com/cpu-boost"             = "false"
                  - "run.googleapis.com/startup-cpu-boost"     = "false" -> null
                    # (3 unchanged elements hidden)
                }
                name             = null
                # (6 unchanged attributes hidden)
            }
          ~ spec {
              ~ container_concurrency = 128 -> 1
              ~ timeout_seconds       = 3 -> 60
                # (3 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Pusher: @legokichi, Action: pull_request

@github-actions

Copy link
Copy Markdown

Terraform Plan Results

Terraform Plan Output

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_cloud_run_service.litestream_sandbox will be updated in-place
  ~ resource "google_cloud_run_service" "litestream_sandbox" {
        id                         = "locations/asia-northeast1/namespaces/duxca-298210/services/litestream-sandbox"
        name                       = "litestream-sandbox"
        # (4 unchanged attributes hidden)

      ~ template {
          ~ metadata {
              ~ annotations      = {
                  + "autoscaling.knative.dev/minScale"         = "0"
                  - "run.googleapis.com/client-name"           = "gcloud" -> null
                  - "run.googleapis.com/client-version"        = "571.0.0" -> null
                  + "run.googleapis.com/cpu-boost"             = "false"
                  - "run.googleapis.com/startup-cpu-boost"     = "false" -> null
                    # (3 unchanged elements hidden)
                }
                name             = null
                # (6 unchanged attributes hidden)
            }
          ~ spec {
              ~ timeout_seconds       = 3 -> 60
                # (4 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }
        }

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Pusher: @legokichi, Action: pull_request

@legokichi
legokichi marked this pull request as ready for review June 11, 2026 17:51
@legokichi
legokichi merged commit a61cd98 into main Jun 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant