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

Publish throughput drop if the size of the stream reaches ~500MB [v2.10.18] #5701

Open
s4iko opened this issue Jul 25, 2024 · 0 comments
Open
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@s4iko
Copy link

s4iko commented Jul 25, 2024

Observed behavior

I deployed a Nats cluster using the helm chart.
3 servers with limits:

  • 2 CPU
  • 4Gi memory

I added 2 streams:

  • 1 with a file storage (discard old, limits 10M messages)
  • 1 with a memory storage (discard old, limits 1M messages)

When I publish messages to the streams it perform well at start:

╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                Streams                                               │
├──────────────────────────────┬─────────────┬─────────────────────┬──────────┬─────────┬──────────────┤
│ Name                         │ Description │ Created             │ Messages │ Size    │ Last Message │
├──────────────────────────────┼─────────────┼─────────────────────┼──────────┼─────────┼──────────────┤
│ stream-file                  │             │ 2023-11-22 18:17:43 │ 838,903  │ 145 MiB │ 5.59s        │

nats bench --js --pub 1 --msgs 100000 --size 128 --syncpub --no-progress --stream "stream-file" "stream-file.subject"
Pub stats: 3,226 msgs/sec ~ 403.30 KB/sec

but after the size of the stream reaches ~500MB the througput drop significantly:

╭───────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                Streams                                                │
├──────────────────────────────┬─────────────┬─────────────────────┬───────────┬─────────┬──────────────┤
│ Name                         │ Description │ Created             │ Messages  │ Size    │ Last Message │
├──────────────────────────────┼─────────────┼─────────────────────┼───────────┼─────────┼──────────────┤
│ stream-file                  │             │ 2023-11-22 18:17:43 │ 3,000,000 │ 518 MiB │ 5.98s        │

nats bench --js --pub 1 --msgs 100000 --size 128 --syncpub --no-progress --stream "stream-file" "stream-file.subject"
Pub stats: 630 msgs/sec ~ 78.76 KB/sec

The same happens for both file or memory streams.
The same happens if no message limit is set.

Thank you for your help (and your awsome product) :)

Expected behavior

The throughput is stable or at least don't drop significantly.

Server and client version

Image server nats:2.10.18-alpine

nats-box:0.14.1 (nats cli v0.1.1)

Host environment

I deployed a Nats cluster using the helm chart.

3 servers with limits:

  • 2 CPU
  • 3Gi memory

I added 2 streams:

  • 1 with a file storage
  • 1 with a memory storage

Steps to reproduce

Create the stream:

nats stream add \
  --retention=limits \
  --storage=file \
  --replicas=1 \
  --discard=old \
  --dupe-window=2m \
  --max-age=-1 \
  --max-msgs=1000000 \
  --max-bytes=-1 \
  --max-msg-size=-1 \
  --max-msgs-per-subject=-1 \
  --max-consumers=-1 \
  --allow-rollup \
  --no-deny-delete \
  --no-deny-purge \
  --subjects="stream-file.subject" \
  "stream-file" > /dev/null

Check the throughput when the stream is empty:

nats bench --js --pub 1 --msgs 100000 --size 1024 --syncpub --no-progress --stream "stream-file" "stream-file.subject"

Publish enough messages to reach ~500MB to 600MB, then the next publish througput drops:

nats bench --js --pub 10 --msgs 400000 --size 1024 --syncpub --no-progress --stream "stream-file" "stream-file.subject"

Check that the throughput drops for next publish:

nats bench --js --pub 1 --msgs 100000 --size 1024 --syncpub --no-progress --stream "stream-file" "stream-file.subject"
@s4iko s4iko added the defect Suspected defect such as a bug or regression label Jul 25, 2024
@s4iko s4iko changed the title Publish througput drop if the stream if the size reach ~500MB Publish througput drop if the size of the stream reaches ~500MB Jul 25, 2024
@wallyqs wallyqs changed the title Publish througput drop if the size of the stream reaches ~500MB Publish throughput drop if the size of the stream reaches ~500MB Aug 27, 2024
@wallyqs wallyqs changed the title Publish throughput drop if the size of the stream reaches ~500MB Publish throughput drop if the size of the stream reaches ~500MB [v2.10.18] Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants