{"record":{"id":"025cacb39ee2f7d8","repo":"aeron-io/aeron","slug":"initialwindowlength-initialwindowlength-so-rcvbuf-sorcvbuf","errorCode":null,"errorMessage":"initialWindowLength=${initialWindowLength} > SO_RCVBUF=${soRcvBuf}, increase ${SOCKET_RCVBUF_LENGTH_PROP_NAME} limits to match initialWindowLength","messagePattern":"initialWindowLength=(.+?) > SO_RCVBUF=(.+?), increase (.+?) limits to match initialWindowLength","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/Configuration.java","lineNumber":2531,"sourceCode":"                \" attempted=\" + ctx.socketRcvbufLength() + \", actual=\" + ctx.osMaxSocketRcvbufLength());\n        }\n\n        final int soSndBuf = 0 == ctx.socketSndbufLength() ?\n            ctx.osDefaultSocketSndbufLength() : ctx.socketSndbufLength();\n\n        if (ctx.mtuLength() > soSndBuf)\n        {\n            throw new ConfigurationException(\n                \"mtuLength=\" + ctx.mtuLength() + \" > SO_SNDBUF=\" + soSndBuf +\n                \", increase \" + SOCKET_SNDBUF_LENGTH_PROP_NAME + \" to match MTU\");\n        }\n\n        final int soRcvBuf = 0 == ctx.socketRcvbufLength() ?\n            ctx.osDefaultSocketRcvbufLength() : ctx.socketRcvbufLength();\n\n        if (ctx.initialWindowLength() > soRcvBuf)\n        {\n            throw new ConfigurationException(\n                \"initialWindowLength=\" + ctx.initialWindowLength() + \" > SO_RCVBUF=\" + soRcvBuf +\n                \", increase \" + SOCKET_RCVBUF_LENGTH_PROP_NAME + \" limits to match initialWindowLength\");\n        }\n    }\n\n    /**\n     * Validate that page size is valid and alignment is valid.\n     *\n     * @param pageSize to be checked.\n     * @throws ConfigurationException if the size is not as expected.\n     */\n    public static void validatePageSize(final int pageSize)\n    {\n        validateValueRange(pageSize, PAGE_MIN_SIZE, PAGE_MAX_SIZE, \"filePageSize\");\n\n        if (!BitUtil.isPowerOfTwo(pageSize))\n        {\n            throw new ConfigurationException(\"filePageSize not a power of 2: \" + pageSize);","sourceCodeStart":2513,"sourceCodeEnd":2549,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/Configuration.java#L2513-L2549","documentation":"Aeron validates that the flow-control initial window length does not exceed the OS socket receive buffer (SO_RCVBUF); otherwise the receiver cannot buffer a full window of data and throughput would be silently capped or datagrams dropped. Configuration throws this ConfigurationException when ctx.initialWindowLength() > soRcvBuf during driver conclusion.","triggerScenarios":"Running Configuration.validateSocketBufferLengths(ctx) when aeron.socket.rcvbuf.length (or the OS default when 0) is smaller than aeron.initial.window.length.","commonSituations":"Increasing initial window for high-throughput links while leaving SO_RCVBUF at defaults or explicitly low; containerized environments with small rmem limits; copying window tuning from guides without matching socket buffer settings.","solutions":["Increase aeron.socket.rcvbuf.length (SOCKET_RCVBUF_LENGTH_PROP_NAME) to >= initialWindowLength","Or lower aeron.initial.window.length to fit within SO_RCVBUF","Raise OS-level net.core.rmem_default / rmem_max if relying on OS defaults","Also ensure the application reads fast enough; a window larger than buffers only masks backpressure"],"exampleFix":"// before\nctx.initialWindowLength(8 * 1024 * 1024);\nctx.socketRcvbufLength(1024 * 1024);\n// after\nctx.initialWindowLength(8 * 1024 * 1024);\nctx.socketRcvbufLength(8 * 1024 * 1024); // >= initialWindowLength","handlingStrategy":"validation","validationCode":"int soRcvBuf = socketRcvbufLength != 0 ? socketRcvbufLength : osDefaultSocketRcvbufLength;\nif (initialWindowLength > soRcvBuf) {\n    throw new IllegalStateException(\"raise aeron.socket.rcvbuf.length to >= \" + initialWindowLength);\n}","typeGuard":null,"tryCatchPattern":"try {\n    mediaCtx.conclude();\n} catch (ConfigurationException e) {\n    if (e.getMessage().contains(\"SO_RCVBUF\")) {\n        mediaCtx.socketRcvbufLength(mediaCtx.initialWindowLength());\n        mediaCtx.conclude();\n    } else { throw e; }\n}","preventionTips":["Keep initialWindowLength <= SO_RCVBUF in config templates","Raise net.core.rmem_max when using multi-MB windows","Document the window/socket-buffer dependency in your deployment runbook"],"tags":["aeron","configuration","socket-buffer","flow-control"],"backgroundTag":"conflicting-config-options","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}