Skip to content

Commit 17d4ec5

Browse files
committed
Updated Startup Script to include command line arguments for smp and memory
Command Line argument Values are now consitent with python, go, java, node and ruby implementations: - https://github.com/testcontainers/testcontainers-python/blob/main/modules/kafka/testcontainers/kafka/_redpanda.py - https://github.com/testcontainers/testcontainers-go/blob/main/modules/redpanda/redpanda.go - https://github.com/testcontainers/testcontainers-java/blob/main/modules/redpanda/src/main/java/org/testcontainers/redpanda/RedpandaContainer.java - https://github.com/testcontainers/testcontainers-node/blob/main/packages/modules/redpanda/src/redpanda-container.ts - https://github.com/testcontainers/testcontainers-ruby/blob/main/redpanda/lib/testcontainers/redpanda.rb These updated values adresses the scenario where multiple redpanda test containers instances are wired up and that some containers stop / fail due to resource exhaustion. The following error is captured from the container which has failed: 2025-02-07 09:45:20 WARN 2025-02-07 17:45:20,613 seastar - Requested AIO slots too large, please increase request capacity in /proc/sys/fs/aio-max-nr. available:6559 requested:110260 2025-02-07 09:45:20 Could not initialize seastar: std::runtime_error (Could not setup Async I/O: Not enough request capacity in /proc/sys/fs/aio-max-nr. Try increasing that number or reducing the amount of logical CPUs available for your application)
1 parent 231e814 commit 17d4ec5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Testcontainers.Redpanda/RedpandaBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ protected override RedpandaBuilder Init()
5959
startupScript.Append(lf);
6060
startupScript.Append("/usr/bin/rpk redpanda start ");
6161
startupScript.Append("--mode dev-container ");
62+
startupScript.Append("--smp 1 ");
63+
startupScript.Append("--memory 1G ");
6264
startupScript.Append("--kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092 ");
6365
startupScript.Append("--advertise-kafka-addr PLAINTEXT://127.0.0.1:29092,OUTSIDE://" + container.Hostname + ":" + container.GetMappedPublicPort(RedpandaPort));
6466
return container.CopyAsync(Encoding.Default.GetBytes(startupScript.ToString()), StartupScriptFilePath, Unix.FileMode755, ct);

0 commit comments

Comments
 (0)