diff --git a/docker-compose-lightweight.yaml b/docker-compose-lightweight.yaml index 8b03b9ea..f2cfb034 100644 --- a/docker-compose-lightweight.yaml +++ b/docker-compose-lightweight.yaml @@ -32,6 +32,13 @@ services: retries: 5 start_period: 10s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M # Idempotent: drizzle skips already-applied migrations on every up db-migrate: @@ -83,6 +90,13 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M status-page: container_name: openstatus-status-page @@ -113,3 +127,10 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M diff --git a/docker-compose.github-packages.yaml b/docker-compose.github-packages.yaml index 087bee87..09de8d10 100644 --- a/docker-compose.github-packages.yaml +++ b/docker-compose.github-packages.yaml @@ -27,6 +27,9 @@ services: - libsql-data:/var/lib/sqld environment: - SQLD_NODE=primary + # Increase limits to handle multiple services without connection pooling + - SQLD_MAX_CONCURRENT_CONNECTIONS=512 + - SQLD_MAX_CONCURRENT_REQUESTS=1024 healthcheck: test: [ @@ -38,6 +41,13 @@ services: retries: 5 start_period: 10s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M tinybird-local: container_name: openstatus-tinybird @@ -111,6 +121,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M server: container_name: openstatus-server @@ -138,6 +155,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M private-location: container_name: openstatus-private-location @@ -171,6 +195,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 256M + deploy: + resources: + limits: + memory: 256M + reservations: + memory: 128M checker: container_name: openstatus-checker @@ -194,6 +225,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 256M + deploy: + resources: + limits: + memory: 256M + reservations: + memory: 128M dashboard: container_name: openstatus-dashboard @@ -225,6 +263,13 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M status-page: container_name: openstatus-status-page @@ -256,3 +301,10 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M diff --git a/docker-compose.yaml b/docker-compose.yaml index 2d0079ea..309ab6b8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -27,6 +27,9 @@ services: - libsql-data:/var/lib/sqld environment: - SQLD_NODE=primary + # Increase limits to handle multiple services without connection pooling + - SQLD_MAX_CONCURRENT_CONNECTIONS=512 + - SQLD_MAX_CONCURRENT_REQUESTS=1024 healthcheck: test: [ @@ -38,6 +41,13 @@ services: retries: 5 start_period: 10s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M tinybird-local: container_name: openstatus-tinybird @@ -111,6 +121,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M server: container_name: openstatus-server @@ -141,6 +158,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M private-location: container_name: openstatus-private-location @@ -177,6 +201,13 @@ services: retries: 3 start_period: 30s restart: unless-stopped + memswap_limit: 256M + deploy: + resources: + limits: + memory: 256M + reservations: + memory: 128M dashboard: container_name: openstatus-dashboard @@ -211,6 +242,13 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M status-page: container_name: openstatus-status-page @@ -245,3 +283,10 @@ services: retries: 3 start_period: 45s restart: unless-stopped + memswap_limit: 512M + deploy: + resources: + limits: + memory: 512M + reservations: + memory: 256M diff --git a/packages/tinybird/scripts/backfill_external_status_v0_to_v1.ts b/packages/tinybird/scripts/backfill_external_status_v0_to_v1.ts index d7debef5..1f104728 100644 --- a/packages/tinybird/scripts/backfill_external_status_v0_to_v1.ts +++ b/packages/tinybird/scripts/backfill_external_status_v0_to_v1.ts @@ -115,17 +115,22 @@ async function loadNameToSlugMap(): Promise> { authToken: env.DATABASE_AUTH_TOKEN, }); const db = drizzle(client); - const rows = await db - .select({ name: externalService.name, slug: externalService.slug }) - .from(externalService) - .where(isNotNull(externalService.slug)) - .all(); - const map = new Map(); - for (const r of rows) { - map.set(r.name, r.slug); + + try { + const rows = await db + .select({ name: externalService.name, slug: externalService.slug }) + .from(externalService) + .where(isNotNull(externalService.slug)) + .all(); + const map = new Map(); + for (const r of rows) { + map.set(r.name, r.slug); + } + console.log(`[backfill] loaded ${map.size} name→slug mappings from libSQL`); + return map; + } finally { + client.close(); } - console.log(`[backfill] loaded ${map.size} name→slug mappings from libSQL`); - return map; } function rowsToSnapshots(args: {