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

Compress editoast cached data #10527

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Compress editoast cached data #10527

merged 1 commit into from
Feb 3, 2025

Conversation

younesschrifi
Copy link
Contributor

@younesschrifi younesschrifi commented Jan 26, 2025

The json request and response from the pathfinding and the simulation take too much time to be get from valkey or push in valkey. The solution is to use gzip to compress the payloads.

Benchmarks

All benchmark were run on dev.

No compression (BATCH_SIZE=500)

  • LMR: ~20s
  • Get from cache (total): 9.4s
  • Get from cache (sum): 14.0s

image

Zstd -1 (BATCH_SIZE=500)

  • LMR: ~20s
  • Get from cache (total): 13.7s
  • Get from cache (sum): 22.6s

image

LZ4 -1 (BATCH_SIZE=500)

  • LMR: ~14.4s
  • Get from cache (total): 8.8s
  • Get from cache (sum): 11.9s

image

@younesschrifi younesschrifi requested a review from a team as a code owner January 26, 2025 23:09
@github-actions github-actions bot added the area:editoast Work on Editoast Service label Jan 26, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 79.48718% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.81%. Comparing base (4f2c918) to head (b0edd25).
Report is 37 commits behind head on dev.

Files with missing lines Patch % Lines
editoast/src/valkey_utils.rs 77.77% 8 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##              dev   #10527    +/-   ##
========================================
  Coverage   81.81%   81.81%            
========================================
  Files        1073     1073            
  Lines      106718   106981   +263     
  Branches      730      728     -2     
========================================
+ Hits        87307    87528   +221     
- Misses      19372    19414    +42     
  Partials       39       39            
Flag Coverage Δ
editoast 74.16% <79.48%> (-0.14%) ⬇️
front 89.37% <ø> (+0.02%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 88.14% <ø> (+1.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@younesschrifi younesschrifi force-pushed the yci/compressed_json branch 5 times, most recently from 4f38679 to 27b1545 Compare January 27, 2025 10:45
Copy link
Contributor

@woshilapin woshilapin left a comment

Choose a reason for hiding this comment

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

Hopes this improve what we're looking for. Do you have some numbers? It would be nice to put them in the description so future us can find these when reevaluating the situation.

@flomonster flomonster changed the title editoast: use gzip to compress cache data Compress editoast cached data Jan 31, 2025
@younesschrifi younesschrifi force-pushed the yci/compressed_json branch 2 times, most recently from 8ce4d41 to ec3675f Compare January 31, 2025 13:30
@flomonster
Copy link
Contributor

Hopes this improve what we're looking for. Do you have some numbers? It would be nice to put them in the description so future us can find these when reevaluating the situation.

We're benchmarking PR. I will add numbers in live :)

@younesschrifi younesschrifi force-pushed the yci/compressed_json branch 2 times, most recently from c268b81 to 35c9cf4 Compare January 31, 2025 15:31
@leovalais
Copy link
Contributor

Wouldn't reducing the batch size improve the performances since transport is likely the limiting factor here?

@flomonster
Copy link
Contributor

We can merge this PR. We've made a slight improvement. The result is not very visible because of other problems I've listed here.

Signed-off-by: Youness CHRIFI ALAOUI <[email protected]>
@younesschrifi younesschrifi added this pull request to the merge queue Feb 3, 2025
Merged via the queue into dev with commit fd615e7 Feb 3, 2025
27 checks passed
@younesschrifi younesschrifi deleted the yci/compressed_json branch February 3, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editoast Work on Editoast Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants