这是indexloc提供的服务,不要输入任何密码
Skip to content

bound the size of query plan cache #5363

@tirumaraiselvan

Description

@tirumaraiselvan

This is one of the TODOs in #3530

  • Consider making the bounded cache the default since...
  • it is equally effective for the use case that the cache was designed for: a finite number of elements
  • even a small size is similarly performant to unbounded when the domain is
    unbounded with long tail (note in this scenario the unbounded cache is
    inappropriate anyway since it implies unbounded space usage)
  • the bookkeeping in the LRU cache might allow us to collect important
    telemetry data from users (see above).

Also, it is impossible to switch off the query plan caching by setting HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE: 0

From code:

 ( "HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE"
  , "The maximum number of query plans that can be cached, allowed values: 0-65535, " <>
    "0 disables the cache. If this value is not set, there is no limit on the number " <>
    "of plans that are cached"
  )

When I set to 0, server doesn't start with

Environment variable HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE: cache size must be given as a number between 1 and 65535

EDIT (Brandon):

  • analyze telemetry we've been collecting about cache to find an appropriate size, and any other insights. Have a back-of-the-envelope figure for how much memory a cache of size N is likely to consume.
  • support disabling cache entirely with 0
  • make bounded the default and update documentation

Metadata

Metadata

Assignees

Labels

c/serverRelated to serverp/highcandidate for being included in the upcoming sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions