Skip to content

Add configurable Grafast cache limits - #1746

Draft
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/grafast-cache-limits
Draft

Add configurable Grafast cache limits#1746
Zetazzz wants to merge 1 commit into
test/performance-harness-corefrom
agent/grafast-cache-limits

Conversation

@Zetazzz

@Zetazzz Zetazzz commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements planning item F06 on top of the reusable performance harness in #1716.

  • adds explicit per-schema limits for Grafast query, operation, and operation-plan caches
  • accepts limits from pgpm.json/runtime options or three environment variables
  • validates every merged configuration source as a safe integer of at least 2
  • installs one schema plugin only when at least one limit is configured
  • preserves Grafast upstream defaults and current behavior when omitted
  • keeps this PR independent of F03 preset-composition work and all scoped-introspection/retirement changes

Configuration

{
  "graphile": {
    "grafastCache": {
      "queryCacheMaxLength": 512,
      "operationsCacheMaxLength": 256,
      "operationOperationPlansCacheMaxLength": 32
    }
  }
}

Equivalent environment variables:

  • GRAPHILE_QUERY_CACHE_MAX_LENGTH
  • GRAPHILE_OPERATIONS_CACHE_MAX_LENGTH
  • GRAPHILE_OPERATION_PLANS_CACHE_MAX_LENGTH

Validation

Passed:

  • focused cache-limit configuration tests: 19 tests
  • full @constructive-io/graphql-env tests: 28 tests
  • focused Grafast cache-limit plugin tests: 6 tests, including real eviction under query diversity
  • full @constructive-io/graphql-server tests: 143 tests
  • performance harness tests: 7 tests
  • CJS and ESM builds for graphql-types, graphql-env, graphile-settings, graphql-server, and perf-harness
  • pnpm install --frozen-lockfile
  • ESLint on all changed TypeScript files (one pre-existing unused catch-variable warning remains in graphql-server)
  • git diff --check

The full graphile-settings run passed 7 of 8 suites (67 tests). Its preset-integration suite has 29 PostgreSQL failures because the local test role lacks permission for schema integration_test. The exact same 29 failures were reproduced on the unchanged base commit 6500d408e9f0e2240f7272869f0f15bf6d12e1fa, so this is a base/environment issue rather than an F06 regression.

Refs constructive-io/constructive-planning#1693.

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