Skip to content

Introduce GZIP compression for RSocket#154

Merged
CodeDrivenMitch merged 1 commit into
mainfrom
feature/gzip-compression
May 8, 2026
Merged

Introduce GZIP compression for RSocket#154
CodeDrivenMitch merged 1 commit into
mainfrom
feature/gzip-compression

Conversation

@CodeDrivenMitch
Copy link
Copy Markdown
Collaborator

This PR introduces GZIP compression on the RSocket protocol. It's only enabled if both the server and the client support it. Payloads that are compressed have a application/vnd.axoniq.platform.compression.v0 MIME header.

Inbound GZIP is also supported. However, the server can only enable it from the first time it received a zipped message. As this is likely to happen quickly, this is fine.

The compression ratios differ. Some calls, like the processor report see up to a 88% reduction in the quickstart. Other calls 63%. Some calls don't report any improvement. Only payloads bigger athan 256 bytes are encrypted, as it would grow because of overhead.

Route Raw Gzipped Ratio Above 256 B? Wire effect
processor-info-report 3 088–3 104 B 368–370 B ~11.9% yes Compressed — saves ~88%
message-flow-stats 2 073 B 761–765 B ~36.7% yes Compressed — saves ~63%
application-info-report 170 B 162–163 B ~95% no Sent raw
entitlement-usage-report 55 B 74 B 134.5% no Sent raw (gzip would grow it)
client-heartbeat 1 B 21 B 2 100% no Sent raw (gzip header alone is 20+ B)

@CodeDrivenMitch CodeDrivenMitch requested a review from a team May 8, 2026 07:48
@CodeDrivenMitch CodeDrivenMitch self-assigned this May 8, 2026
@CodeDrivenMitch CodeDrivenMitch requested review from alex-w0 and stefanmirkovic and removed request for a team May 8, 2026 07:48
This PR introduces GZIP compression on the RSocket protocol. It's only enabled if both the server and the client support it. Payloads that are compressed have a `application/vnd.axoniq.platform.compression.v0` MIME header.

Inbound GZIP is also supported. However, the server can only enable it from the first time it received a zipped message. As this is likely to happen quickly, this is fine.

The compression ratios differ. Some calls, like the processor report see up to a 88% reduction in the quickstart. Other calls 63%. Some calls don't report any improvement. Only payloads bigger athan 256 bytes are encrypted, as it would grow because of overhead.

| Route                      |           Raw |   Gzipped |      Ratio | Above 256 B? | Wire effect                           |
|----------------------------|--------------:|----------:|-----------:|:------------:|---------------------------------------|
| `processor-info-report`    | 3 088–3 104 B | 368–370 B | **~11.9%** |     yes      | Compressed — saves ~88%               |
| `message-flow-stats`       |       2 073 B | 761–765 B | **~36.7%** |     yes      | Compressed — saves ~63%               |
| `application-info-report`  |         170 B | 162–163 B |       ~95% |      no      | Sent raw                              |
| `entitlement-usage-report` |          55 B |      74 B | **134.5%** |      no      | Sent raw (gzip would grow it)         |
| `client-heartbeat`         |           1 B |      21 B |     2 100% |      no      | Sent raw (gzip header alone is 20+ B) |
@CodeDrivenMitch CodeDrivenMitch force-pushed the feature/gzip-compression branch from 0ae86f8 to 1625129 Compare May 8, 2026 09:52
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@CodeDrivenMitch CodeDrivenMitch merged commit 20dc879 into main May 8, 2026
3 checks passed
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.

2 participants