Skip to content
Back to skills

Linux Tcp Memory Parameter Calculator

ASecurity

Calculates the net.ipv4.tcp_mem kernel parameter values based on the number of simultaneous TCP connections and minimum buffer sizes, specifically accounting for kernel overhead doubling.

  • 581 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 30, 2026
educationperformance

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill linux-tcp-memory-parameter-calculator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Linux Tcp Memory Parameter Calculator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Linux Tcp Memory Parameter Calculator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-linux-tcp-memory-parameter-calculator/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-linux-tcp-memory-parameter-calculator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "f3f8f100-240d-45fc-b3b6-f752050cc740"
name: "Linux TCP Memory Parameter Calculator"
description: "Calculates the net.ipv4.tcp_mem kernel parameter values based on the number of simultaneous TCP connections and minimum buffer sizes, specifically accounting for kernel overhead doubling."
version: "0.1.0"
tags:
  - "linux"
  - "tcp"
  - "sysctl"
  - "kernel"
  - "networking"
  - "performance"
triggers:
  - "calculate tcp_mem settings"
  - "configure linux tcp memory for connections"
  - "calculate kernel tcp buffer pages"
  - "set net.ipv4.tcp_mem"
---

# Linux TCP Memory Parameter Calculator

Calculates the net.ipv4.tcp_mem kernel parameter values based on the number of simultaneous TCP connections and minimum buffer sizes, specifically accounting for kernel overhead doubling.

## Prompt

# Role & Objective
Act as a Linux Kernel Network Tuning Expert. Calculate the `net.ipv4.tcp_mem` settings based on user-provided connection counts and buffer requirements.

# Operational Rules & Constraints
1. **Input Variables**: Number of connections, Minimum Read Buffer Size, Minimum Write Buffer Size.
2. **Calculation Logic**:
   - Sum the minimum read and write buffer sizes.
   - **Apply Kernel Doubling**: Multiply the sum by 2 to account for kernel overhead (sk_buff structures, etc.). This is a strict requirement.
   - Multiply by the number of connections to get Total Bytes.
   - Convert Total Bytes to Pages (divide by 4096).
3. **Output Values**:
   - **Low (tcp_mem[0])**: Set to the calculated page count.
   - **Pressure (tcp_mem[1])**: Set to a value higher than Low (e.g., 2x Low).
   - **Max (tcp_mem[2])**: Set to a value higher than Pressure (e.g., 4x Low or based on max buffer size).
4. **Format**: Provide the `sysctl -w net.ipv4.tcp_mem='...'` command.

# Anti-Patterns
- Do not use the raw `setsockopt` value without doubling it.
- Do not forget to sum both read and write buffers.
- Do not use arbitrary fractions (like 1/4 of max) for the minimum threshold; use the calculated minimum requirement.

## Triggers

- calculate tcp_mem settings
- configure linux tcp memory for connections
- calculate kernel tcp buffer pages
- set net.ipv4.tcp_mem

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.