{"record":{"id":"d2bfb11ebb30dcf1","repo":"apache/druid","slug":"unable-to-read-proc-sys-net-core-somaxconn-falli","errorCode":null,"errorMessage":"Unable to read /proc/sys/net/core/somaxconn, falling back to default value for TCP accept queue size","messagePattern":"Unable to read /proc/sys/net/core/somaxconn, falling back to default value for TCP accept queue size","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java","lineNumber":508,"sourceCode":"  private static int getMaxJettyAcceptorsSelectorsNum(DruidNode druidNode)\n  {\n    // This computation is based on Jetty v9.3.19 which uses upto 8(4 acceptors and 4 selectors) threads per\n    // ServerConnector\n    int numServerConnector = (druidNode.isEnablePlaintextPort() ? 1 : 0) + (druidNode.isEnableTlsPort() ? 1 : 0);\n    return numServerConnector * 8;\n  }\n\n  private static int getTCPAcceptQueueSize()\n  {\n    if (SystemUtils.IS_OS_LINUX) {\n      try (BufferedReader in = Files.newBufferedReader(Paths.get(\"/proc/sys/net/core/somaxconn\"))) {\n        String acceptQueueSize = in.readLine();\n        if (acceptQueueSize != null) {\n          return Integer.parseInt(acceptQueueSize);\n        }\n      }\n      catch (Exception e) {\n        log.warn(\"Unable to read /proc/sys/net/core/somaxconn, falling back to default value for TCP accept queue size\");\n      }\n    }\n    return 128; // Default value of net.core.somaxconn\n  }\n\n  @Provides\n  @LazySingleton\n  public JettyMonitor getJettyMonitor()\n  {\n    return new JettyMonitor();\n  }\n\n  public static class JettyMonitor extends AbstractMonitor\n  {\n    @Override\n    public boolean doMonitor(ServiceEmitter emitter)\n    {\n      final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder();","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java#L490-L526","documentation":"JettyServerModule tries to tune Jetty's TCP accept queue size from the OS setting /proc/sys/net/core/somaxconn. If that file cannot be read or parsed, it logs this warning and falls back to the default value of 128.","triggerScenarios":"makeAndInitializeServer calls getTCPAcceptQueueSize; BufferedReader readLine() or Integer.parseInt() on the file's content throws (file missing, permission denied, unexpected content, non-Linux OS without /proc).","commonSituations":"Running Druid in containers/OSes where /proc/sys/net/core/somaxconn is absent or restricted; read-only /proc mounts; hardened security profiles (SELinux/AppArmor) blocking the read.","solutions":["Verify the file exists and is readable: cat /proc/sys/net/core/somaxconn.","If the warning is acceptable, do nothing — behavior falls back to acceptQueueSize 128.","For a larger backlog, raise the OS limit (sysctl -w net.core.somaxconn=4096) so Jetty picks it up.","Alternatively set druid.server.http.numAcceptors/queue sizing explicitly in runtime properties if tuning is needed."],"exampleFix":"// before: container without /proc read access -> warning at startup\n// after: grant read access or preset the sysctl in the image\nsysctl -w net.core.somaxconn=1024","handlingStrategy":"fallback","validationCode":"long somaxconn = -1;\ntry (BufferedReader in = new BufferedReader(new FileReader(\"/proc/sys/net/core/somaxconn\"))) {\n  somaxconn = Long.parseLong(in.readLine().trim());\n} catch (Exception e) {\n  // non-Linux or restricted /proc; default 128 will be used\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify /proc/sys/net/core/somaxconn is readable in your container image.","Set net.core.somaxconn explicitly in host/container sysctl config.","Treat the startup warning as informational unless you need a large accept backlog."],"tags":["jetty","network","linux","fallback"],"backgroundTag":"file-read-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}