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

Lower stack chunk size in RTS to reduce thread STACK memory (closes #5190) #5214

Conversation

jberryman
Copy link
Collaborator

Broke out this simple commit from this other PR that had a larger change still under discussion: #5191 (review)

Closes #5190

…asura#5190)

This reduces memory consumption for new idle subscriptions significantly
(see linked ticket).

The hypothesis is: we fork a lot of threads per websocket, and some of
these use slightly more than the initial 1K stack size, so the first
overflow balloons to 32K, when significantly less is required.

However: running with `+RTS -K1K -xc` did not seem to show evidence of
any overflows! So it's a mystery why this improves things.

GHC should probably also be doubling the stack buffer at each overflow
or doing something even smarter; the knobs we have aren't so helpful.
@jberryman jberryman requested a review from a team as a code owner June 25, 2020 18:44
@jberryman jberryman requested a review from 0x777 June 25, 2020 18:45
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog

@hasura-bot
Copy link
Contributor

Review app for commit 1dbe5cd deployed to Heroku: https://hge-ci-pull-5214.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5214-1dbe5cd1

@jberryman jberryman merged commit 93104e6 into hasura:master Jun 26, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-5214.herokuapp.com is deleted

@jberryman jberryman deleted the 5190-improve-websockets-idle-memory-v2-only-kc8 branch June 26, 2020 22:25
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.

Improve memory usage from STACK in websockets
4 participants