Closed kung-foo closed 1 year ago
Possibly related to https://github.com/nats-io/nats-server/issues/3948
What does nats stream info
show for the stream in question when the performance is the slowest?
❯ nats stream info TEST
Information for Stream TEST created 2023-04-12 21:29:22
Subjects: foo.>
Replicas: 1
Storage: Memory
Options:
Retention: Limits
Acknowledgments: true
Discard Policy: Old
Duplicate Window: 2m0s
Allows Msg Delete: true
Allows Purge: true
Allows Rollups: false
Limits:
Maximum Messages: 100,000
Maximum Per Subject: unlimited
Maximum Bytes: 1.0 GiB
Maximum Age: unlimited
Maximum Message Size: unlimited
Maximum Consumers: unlimited
State:
Messages: 100,000
Bytes: 22 MiB
FirstSeq: 462,655 @ 2023-04-12T19:31:53 UTC
LastSeq: 562,654 @ 2023-04-12T19:32:30 UTC
Active Consumers: 0
Number of Subjects: 4,096
ok yes I understand what the issue is, apologies for needing to jog my memory..
Not sure there is much we can do for 2.9.16, but are looking to improve for 2.10.
Defect
Writes to JetStream seem to slow down drastically when there is a constrained number of subjects and there is a size/count/ttl limit applied.
For example, with a stream limited to 100k messages and writing 1m messages
Versions of
nats-server
and affected client libraries used:Tested with 2.9.6 and 2.10.0-beta.30 (via nats cli)
OS/Container environment:
Steps or code to reproduce the issue:
Expected result:
Running with different
--multisubjectmax
values should result in similar performaceActual result: