High cpu load after upgrading to 13.1.0
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Product
Hot Chocolate
Describe the bug
Once updated from HC 13.0.5 to 13.1.0 application suddenly starts consuming a lot of CPU. Not immediately after start but in 5-15 minutes. Essentially requests are stopped from being processed. Queries start to take up to 1 minute to execute. UPD: Important observation: subscriptions initiate exponential CPU utilisation growth. around 100 subscriptions essentially render the service unresponsive
Grafana dashboard metric illustration of the issue:
CPU profiling attempts were done using perf tool. I didn’t observe anything that stands out from default .net classes. All CPU consumption is taken by classes related to the ThreadPool. Flame graph generated by the profiling report shows even less data:
Steps to reproduce
- Update to version 13.1.0 or 14 preview
- Make requests
- Wait
- Check metrics
Relevant log output
N/A
Additional Context?
net7.0 DB: MongoDB hosting: Docker, Kubernetes. (base image: mcr.microsoft.com/dotnet/aspnet:7.0) HC websocket subscriptions with redis adapter Authorization enabled Data Loaders are not used - resolvers only if that matters
Version
13.1.0
Issue Analytics
- State:
- Created 4 months ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
This one is now fixed with 13.2.0-preview.2
I have the same problem, using .NET 6 with version HC 13.1.0, running with “dotnet run” on my desktop.
In Banana Cake Pop when I start “Run” on a subscription everything is ok
Then when I press “Cancel”, to stop the subscription, my app starts to cpu spike in the Task manager, this is instant with the Subscription Protocol set to Auto, GraphQL WebSocket or Apollo WebSocket, with GraphQL SSE, there is a wait time of around 6 seconds, before the cpu usage starts to spike.