Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak during configuration update #756

Open
flymedllva opened this issue Apr 25, 2024 · 8 comments
Open

Memory leak during configuration update #756

flymedllva opened this issue Apr 25, 2024 · 8 comments
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.

Comments

@flymedllva
Copy link
Contributor

flymedllva commented Apr 25, 2024

Component(s)

router

Component version

wgc version

controlplane version

router version

v0.82.1

What happened?

Description

When updating the router configuration using r.updateServerAndStart, memory consumption increases.

Enough N times, make the schema puller download and apply a new schema, each time a new schema is applied (they must be different) the memory consumption of the application increases.

This is especially noticeable on large schematics larger than 20 mb.

Steps to Reproduce

I made an example frequently updating the schema, after a few minutes of router operation the memory consumption increases even on a small schema

In order to reproduce, clone the repository and start the router

https://github.com/flymedllva/cosmo-memory-leak-during-configuration-update

cd router && make dev

Commit necessary to reproduce the problem: https://github.com/flymedllva/cosmo-memory-leak-during-configuration-update/commit/880955ebc9e0435e3d9c2dfed7faa3dfb57f56c9

Environment information

OS: 14.4 (23E214)
Package Manager: npm
Compiler(if manually compiled): go version go1.22.1 darwin/arm64

Router configuration

version: "1"

# General router options
graph:
  name: "production"
  token: ""

log_level: "info"
listen_addr: "localhost:3002"
playground_enabled: true
introspection_enabled: true
json_log: true
shutdown_delay: 15s
grace_period: 20s
poll_interval: 10s
health_check_path: "/health"
readiness_check_path: "/health/ready"
liveness_check_path: "/health/live"
router_config_path: "config.json"

cors:
  allow_origins: ["*"]
  allow_methods:
    - HEAD
    - GET
    - POST
  allow_headers:
    - Origin
    - Content-Length
    - Content-Type
  allow_credentials: true
  max_age_minutes: 5m

# Config for custom modules   
# See "https://cosmo-docs.wundergraph.com/router/custom-modules" for more information   
modules:
  myModule:
    # Arbitrary values, unmarshalled by the module
    value: 1

Router execution config

No response

Log output

No response

Additional context

Screenshot 2024-04-26 at 00 53 45
@flymedllva flymedllva added the bug Something isn't working label Apr 25, 2024
Copy link

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

@StarpTech
Copy link
Contributor

Hi @flymedllva please provide a reproducible example. We can't investigate with this little information. Waiting for your feedback!

@StarpTech StarpTech added question Further information is requested internally-reviewed The issue has been reviewed internally. and removed question Further information is requested labels Apr 30, 2024
@flymedllva
Copy link
Contributor Author

@StarpTech Enough N times, make the schema puller download and apply a new schema, each time a new schema is applied (they must be different) the memory consumption of the application increases.

@flymedllva
Copy link
Contributor Author

@StarpTech hi, I've updated the issue description with a handy example to reproduce the issue, have a look again

Thanks

@StarpTech
Copy link
Contributor

@flymedllva thank you. We'll take a look.

@flymedllva
Copy link
Contributor Author

Have you looked at this problem? Any news?

@StarpTech
Copy link
Contributor

Hi @flymedllva, it is on our list, but it is not our highest priority. Please consider #756 (comment). If this issue prevents you from making progress with WunderGraph, please consider becoming a customer. This allows us to put the necessary resources on this.

@Aenimus
Copy link
Member

Aenimus commented Sep 20, 2024

Hi @flymedllva

Has this improved with the latest version?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.
Projects
None yet
Development

No branches or pull requests

3 participants