Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jherrera-jump
Copy link
Contributor

@jherrera-jump jherrera-jump commented Jun 10, 2025

Allows clients to optionally compress websocket messages larger than 200 bytes (arbitrary threshold).

see firedancer-io/firedancer-frontend#33

@jherrera-jump jherrera-jump force-pushed the jherrera/websocket-compression branch 3 times, most recently from 10a88e7 to 6e12737 Compare June 10, 2025 20:58
@jherrera-jump jherrera-jump marked this pull request as ready for review June 10, 2025 21:00
@jherrera-jump jherrera-jump force-pushed the jherrera/websocket-compression branch 3 times, most recently from 94460a1 to 3446eea Compare June 10, 2025 21:29
@jherrera-jump
Copy link
Contributor Author

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.

@jherrera-jump jherrera-jump force-pushed the jherrera/websocket-compression branch 7 times, most recently from 58613db to 18eaf56 Compare June 13, 2025 18:55
@jherrera-jump jherrera-jump force-pushed the jherrera/websocket-compression branch from 18eaf56 to a2bfb2b Compare June 16, 2025 15: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.

1 participant