agentsclimarketplace

Linux tcp memory parameter calculator

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/linux-tcp-memory-parameter-calculator

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill linux-tcp-memory-parameter-calculator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

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.

SKILL.md

2.1 KB, as published. Nobody here has run it

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

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.