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

Reduce memory consumption during proxying #261

Open
3 tasks
simonmittag opened this issue Jun 21, 2022 · 0 comments
Open
3 tasks

Reduce memory consumption during proxying #261

simonmittag opened this issue Jun 21, 2022 · 0 comments
Assignees

Comments

@simonmittag
Copy link
Owner

Why

During this run, we consumed 8GB for 64k connections on HTTP1.1: https://github.com/simonmittag/j8a-performance/blob/master/results/7/pt-j8a1/output.json

{"level":"info","srvId":"e21fbe1a","pid":10468,"pidCpuCorePct":"788.39","pidMemPct":"9.28","pidDwnOpenTcpConns":65536,"pidDwnMaxOpenTcpConns":65536,"pidUpOpenTcpConns":34188,"pidUpMaxOpenTcpConns":34188,"pidMemRssBytes":1990791168,"pidMemVmsBytes":2714484736,"pidMemSwapBytes":0,"pidOSThreads":36,"pidOSUlimit":1048576,"time":"2022-06-20T00:32:01Z","message":"server performance"}
{"level":"info","srvId":"e21fbe1a","pid":10468,"pidCpuCorePct":"793.44","pidMemPct":"38.14","pidDwnOpenTcpConns":65536,"pidDwnMaxOpenTcpConns":65536,"pidUpOpenTcpConns":31660,"pidUpMaxOpenTcpConns":34188,"pidMemRssBytes":8177192960,"pidMemVmsBytes":8857845760,"pidMemSwapBytes":0,"pidOSThreads":36,"pidOSUlimit":1048576,"time":"2022-06-20T00:33:06Z","message":"server performance"}
{"level":"info","srvId":"e21fbe1a","pid":10468,"pidCpuCorePct":"788.87","pidMemPct":"38.92","pidDwnOpenTcpConns":65536,"pidDwnMaxOpenTcpConns":65536,"pidUpOpenTcpConns":31965,"pidUpMaxOpenTcpConns":34188,"pidMemRssBytes":8345534464,"pidMemVmsBytes":9135472640,"pidMemSwapBytes":0,"pidOSThreads":36,"pidOSUlimit":1048576,"time":"2022-06-20T00:34:11Z","message":"server performance"}
{"level":"info","srvId":"e21fbe1a","pid":10468,"pidCpuCorePct":"786.43","pidMemPct":"37.28","pidDwnOpenTcpConns":46440,"pidDwnMaxOpenTcpConns":65536,"pidUpOpenTcpConns":29012,"pidUpMaxOpenTcpConns":34188,"pidMemRssBytes":7993102336,"pidMemVmsBytes":9275465728,"pidMemSwapBytes":0,"pidOSThreads":36,"pidOSUlimit":1048576,"time":"2022-06-20T00:35:14Z","message":"server performance"}

What

  • reduce allocations for proxying, especially body reads.
  • can we get away with not copying the body if we want to do retries? would have to see if for retries we can re-read the body
  • for response rewriting this should be ok, except we'd have to pipe what is being read through Gzip and Brotli encoders as necessary. if we do that, it'd have to be buffered to minimum blocksize for both algs
@simonmittag simonmittag self-assigned this Jun 21, 2022
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

No branches or pull requests

1 participant