Shinto C V
Shinto C V

Reputation: 774

How to set Kernel parameters using sysctl for a Hashicorp Nomad job

The docs says I can set the kernel parameters using sysctl for a docker task like so:

config {
  sysctl = {
    "net.core.somaxconn" = "16384"
  }
}

This indeed works. But when I tried,

     sysctl = {
          "net.core.somaxconn" = "16384"
          "net.core.rmem_default" = 134217728
          "net.core.rmem_max" = 134217728
          "net.core.wmem_default" = 134217728
          "net.core.wmem_max" = 134217728
          "vm.max_map_count" = 1000000
        }

I'm getting the following error.

Sep 28, '22 19:30:22 +0530  
Driver Failure  
Failed to start container fa2179c3fbfe0a216e457449cfb72a78e08c0be45f10ba9596004fbfc51e5cac: API error (400):
failed to create shim task: OCI runtime create failed: 
runc create failed: 
unable to start container process: 
error during container init: 
open /proc/sys/net/core/rmem_default: 
no such file or directory: unknown

I couldn't find anywhere in the docs what are the allowed parameters to set using this config.

I spent the whole day banging my head on this issue.

Please let me know if any more info is needed.

In case you are curious I'm trying to run Solana devnet validator as a container in Nomad.

Upvotes: -1

Views: 543

Answers (1)

KamilCuk
KamilCuk

Reputation: 141698

open /proc/sys/net/core/rmem_default: no such file or directory: unknown

There is just no such sysctl parameter inside docker container when it is running inside network namespace. That's unrelated to nomad. See https://github.com/moby/moby/issues/42282 follow https://github.com/moby/moby/issues/30778 etc.

Upvotes: 0

Related Questions