Skip to content

Memory-efficient way of retrieving /.well-known/jwks.json when instance has large number of Keys #1802

Open
@seanadkinson

Description

@seanadkinson

Memory-efficient way of retrieving /.well-known/jwks.json when instance has large number of Keys

Problem

We have 2983 Applications in our instance, and 8375 keys in Key Master. When requesting /.well-known/jwks.json, we are getting 100k lines of JSON, and currently getting an OOM error when parsing.

Solution

We need a memory-efficient way of retrieving these keys. Could that result set be paged? Any query params available to specify a subset of keys, if we happen to know the ones we want? I'm not sure if that's feasible, but just looking for ideas/options.

Alternatives/workarounds

We can increase memory and solve in the short term, but would you have any recommendations for a longer-term fix?

Additional context

Each one of our Customers is created as an Application in FusionAuth. As mentioned above, we have almost 3k customers. The server that was retrieving jwks.json is a dropwizard service running in docker with 1gb of memory. We have increased this to 2gb to avoid the error for now, but eventually we'll need a memory-efficient solution.

Related issues:

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

How to vote

Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions