-
Notifications
You must be signed in to change notification settings - Fork 312
gui: compress ws messages #5337
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
base: main
Are you sure you want to change the base?
Conversation
10a88e7
to
6e12737
Compare
94460a1
to
3446eea
Compare
Without compression (.venv) [jherrera@tsnj2-ossdev-firedancer39 gui]$ python3 bandwidth.py
Incoming bandwidth for ('peers', 'update') : 50.68 Mbps
Incoming bandwidth for ('epoch', 'new') : 8.87 Mbps
Incoming bandwidth for ('summary', 'live_tile_timers') : 0.15 Mbps
Incoming bandwidth for ('summary', 'live_txn_waterfall') : 0.05 Mbps
Incoming bandwidth for ('summary', 'tps_history') : 0.03 Mbps
Incoming bandwidth for ('summary', 'live_tile_primary_metric') : 0.02 Mbps
Incoming bandwidth for ('slot', 'update') : 0.02 Mbps
Incoming bandwidth for ('summary', 'startup_progress') : 0.01 Mbps
Incoming bandwidth for ('summary', 'tiles') : 0.01 Mbps
Incoming bandwidth for ('summary', 'estimated_tps') : 0.00 Mbps
Incoming bandwidth for ('summary', 'estimated_slot_duration_nanos') : 0.00 Mbps
Incoming bandwidth for ('summary', 'optimistically_confirmed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'completed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'root_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'skip_rate') : 0.00 Mbps
Total incoming bandwidth: 59.85 Mbps
Incoming bandwidth for ('summary', 'live_tile_timers') : 0.14 Mbps
Incoming bandwidth for ('summary', 'live_txn_waterfall') : 0.06 Mbps
Incoming bandwidth for ('slot', 'update') : 0.02 Mbps
Incoming bandwidth for ('summary', 'live_tile_primary_metric') : 0.02 Mbps
Incoming bandwidth for ('summary', 'estimated_tps') : 0.00 Mbps
Incoming bandwidth for ('summary', 'optimistically_confirmed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'estimated_slot_duration_nanos') : 0.00 Mbps
Total incoming bandwidth: 0.24 Mbps
Incoming bandwidth for ('summary', 'live_tile_timers') : 0.14 Mbps
Incoming bandwidth for ('summary', 'live_txn_waterfall') : 0.05 Mbps
Incoming bandwidth for ('summary', 'live_tile_primary_metric') : 0.02 Mbps
Incoming bandwidth for ('slot', 'update') : 0.02 Mbps
Incoming bandwidth for ('summary', 'estimated_tps') : 0.00 Mbps
Incoming bandwidth for ('summary', 'estimated_slot_duration_nanos') : 0.00 Mbps
Incoming bandwidth for ('summary', 'optimistically_confirmed_slot') : 0.00 Mbps
Total incoming bandwidth: 0.24 Mbps With compression (.venv) [jherrera@tsnj2-ossdev-firedancer39 fd1]$ python3 src/disco/gui/bandwidth.py
Incoming bandwidth for ('peers', 'update') : 11.87 Mbps
Incoming bandwidth for ('epoch', 'new') : 4.48 Mbps
Incoming bandwidth for ('summary', 'live_tile_timers') : 0.15 Mbps
Incoming bandwidth for ('summary', 'live_txn_waterfall') : 0.03 Mbps
Incoming bandwidth for ('summary', 'live_tile_primary_metric') : 0.01 Mbps
Incoming bandwidth for ('slot', 'update') : 0.01 Mbps
Incoming bandwidth for ('summary', 'tps_history') : 0.01 Mbps
Incoming bandwidth for ('summary', 'estimated_tps') : 0.00 Mbps
Incoming bandwidth for ('summary', 'startup_progress') : 0.00 Mbps
Incoming bandwidth for ('summary', 'estimated_slot_duration_nanos') : 0.00 Mbps
Incoming bandwidth for ('summary', 'optimistically_confirmed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'tiles') : 0.00 Mbps
Incoming bandwidth for ('summary', 'completed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'root_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'skip_rate') : 0.00 Mbps
Total incoming bandwidth: 16.58 Mbps
Incoming bandwidth for ('summary', 'live_tile_timers') : 0.14 Mbps
Incoming bandwidth for ('summary', 'live_txn_waterfall') : 0.03 Mbps
Incoming bandwidth for ('summary', 'live_tile_primary_metric') : 0.01 Mbps
Incoming bandwidth for ('slot', 'update') : 0.01 Mbps
Incoming bandwidth for ('summary', 'estimated_tps') : 0.00 Mbps
Incoming bandwidth for ('summary', 'optimistically_confirmed_slot') : 0.00 Mbps
Incoming bandwidth for ('summary', 'estimated_slot_duration_nanos') : 0.00 Mbps
Total incoming bandwidth: 0.20 Mbps Note that since small messages are not compressed, the bandwidth after startup is barely changed. |
18eaf56
to
a2bfb2b
Compare
c47d81c
to
f564feb
Compare
2cfed3c
to
c25d68e
Compare
517d5c9
to
f89d914
Compare
e81889b
to
0b4c3ca
Compare
7c3edcc
to
871b9d2
Compare
361cc4f
to
b7a86ea
Compare
src/waltz/http/fd_http_server.c
Outdated
http->stage_len = 0UL; | ||
#if FD_HAS_ZSTD | ||
uchar * _zstd_ctx = FD_SCRATCH_ALLOC_APPEND( l, 16UL, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL ) ); | ||
http->zstd_ctx = ZSTD_initStaticCCtx(_zstd_ctx, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL on error, and formatting, I'd also move the init stuff down below with the other joins()
http->zstd_ctx = ZSTD_initStaticCCtx(_zstd_ctx, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL )); | |
http->zstd_ctx = ZSTD_initStaticCCtx( _zstd_ctx, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL ) ); |
src/waltz/http/fd_http_server.c
Outdated
#if FD_HAS_ZSTD | ||
uchar * _zstd_ctx = FD_SCRATCH_ALLOC_APPEND( l, 16UL, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL ) ); | ||
http->zstd_ctx = ZSTD_initStaticCCtx(_zstd_ctx, ZSTD_estimateCCtxSize( FD_HTTP_ZSTD_COMPRESSION_LEVEL )); | ||
ulong err = ZSTD_CCtx_setParameter(http->zstd_ctx, 100, FD_HTTP_ZSTD_COMPRESSION_LEVEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ulong err = ZSTD_CCtx_setParameter(http->zstd_ctx, 100, FD_HTTP_ZSTD_COMPRESSION_LEVEL); | |
ulong err = ZSTD_CCtx_setParameter( http->zstd_ctx, 100, FD_HTTP_ZSTD_COMPRESSION_LEVEL ); |
int stage_err; | ||
ulong stage_off; | ||
ulong stage_len; | ||
|
||
/* The server needs to maintain two copies of the data (one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
a3ed74d
to
3111f6a
Compare
3111f6a
to
3794d44
Compare
3794d44
to
b234e5e
Compare
Allows clients to optionally compress websocket messages larger than 200 bytes (arbitrary threshold).
see firedancer-io/firedancer-frontend#33