Skip to content

Commit

Permalink
Prepare benchmarks for memory streams (#6318)
Browse files Browse the repository at this point in the history
Benchmarks like `BenchmarkJetStreamPublish` would fail when changed to
use memory-based storage with the following message:
```
BenchmarkJetStreamPublish/N=3,R=3,MsgSz=1024b,Subjs=1/Async[W:4000]
    jetstream_benchmark_test.go:738: Publish timed out
```
This was due to the underlying error being hit:
```
Apply stream entries for '$G > S' got error processing message: insufficient resources (10023)
```

Making the maximums consistent so all file-based benchmarks/tests can
also run for memory-based without timing out due to insufficient
resources.

Signed-off-by: Maurice van Veen <[email protected]>
  • Loading branch information
derekcollison authored Jan 6, 2025
2 parents c558b24 + a133171 commit b49ed3c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions server/jetstream_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var jsClusterAccountsTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
leaf {
listen: 127.0.0.1:-1
Expand Down Expand Up @@ -143,7 +143,7 @@ var jsClusterAccountsTempl = `
var jsClusterTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
leaf {
listen: 127.0.0.1:-1
Expand All @@ -162,7 +162,7 @@ var jsClusterTempl = `
var jsClusterEncryptedTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s', key: "s3cr3t!"}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s', key: "s3cr3t!"}
leaf {
listen: 127.0.0.1:-1
Expand All @@ -181,7 +181,7 @@ var jsClusterEncryptedTempl = `
var jsClusterMaxBytesTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
leaf {
listen: 127.0.0.1:-1
Expand Down Expand Up @@ -291,7 +291,7 @@ var jsGWTempl = `%s{name: %s, urls: [%s]}`
var jsClusterAccountLimitsTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
cluster {
name: %s
Expand Down Expand Up @@ -599,7 +599,7 @@ func (sc *supercluster) waitOnPeerCount(n int) {
var jsClusterMirrorSourceImportsTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
cluster {
name: %s
Expand Down Expand Up @@ -635,7 +635,7 @@ var jsClusterMirrorSourceImportsTempl = `
var jsClusterImportsTempl = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
cluster {
name: %s
Expand Down Expand Up @@ -872,15 +872,15 @@ func (c *cluster) createSingleLeafNodeNoSystemAccountAndEnablesJetStreamWithDoma
var jsClusterSingleLeafNodeLikeNGSTempl = `
listen: 127.0.0.1:-1
server_name: LNJS
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
leaf { remotes [ { urls: [ %s ] } ] }
`

var jsClusterSingleLeafNodeTempl = `
listen: 127.0.0.1:-1
server_name: LNJS
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
leaf { remotes [
{ urls: [ %s ], account: "JSY" }
Expand All @@ -897,7 +897,7 @@ var jsClusterSingleLeafNodeTempl = `
var jsClusterTemplWithLeafNode = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
{{leaf}}
Expand All @@ -916,7 +916,7 @@ var jsClusterTemplWithLeafNodeNoJS = `
server_name: %s
# Need to keep below since it fills in the store dir by default so just comment out.
# jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
# jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
{{leaf}}
Expand All @@ -933,7 +933,7 @@ var jsClusterTemplWithLeafNodeNoJS = `
var jsClusterTemplWithSingleLeafNode = `
listen: 127.0.0.1:-1
server_name: %s
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
{{leaf}}
Expand All @@ -945,7 +945,7 @@ var jsClusterTemplWithSingleFleetLeafNode = `
listen: 127.0.0.1:-1
server_name: %s
cluster: { name: fleet }
jetstream: {max_mem_store: 256MB, max_file_store: 2GB, store_dir: '%s'}
jetstream: {max_mem_store: 2GB, max_file_store: 2GB, store_dir: '%s'}
{{leaf}}
Expand Down

0 comments on commit b49ed3c

Please sign in to comment.