@@ -61,6 +61,7 @@ Or use the NPM wrapper:
6161| ` nettune.snapshot_server ` | Create a configuration snapshot for rollback |
6262| ` nettune.list_profiles ` | List available optimization profiles |
6363| ` nettune.show_profile ` | Show details of a specific profile |
64+ | ` nettune.create_profile ` | Create a custom optimization profile |
6465| ` nettune.apply_profile ` | Apply a profile (dry_run or commit mode) |
6566| ` nettune.rollback ` | Rollback to a previous snapshot |
6667| ` nettune.status ` | Get current server status and configuration |
@@ -139,6 +140,7 @@ Flags:
139140### Profile Endpoints
140141
141142- ` GET /profiles ` - List profiles
143+ - ` POST /profiles ` - Create a new profile
142144- ` GET /profiles/:id ` - Get profile details
143145
144146### System Endpoints
@@ -205,23 +207,64 @@ Analyze the baseline results to classify the network situation:
205207- Diagnosis: Current configuration is performing well
206208- Recommended action: No changes needed; document current state
207209
208- ### Phase 3: Profile Selection
210+ ### Phase 3: Profile Selection or Creation
209211
210212Based on diagnosis:
211213
2122141. Call `nettune.list_profiles` to see available profiles
2132152. Call `nettune.show_profile` for candidate profiles to understand their settings
214- 3. Select the most appropriate profile based on:
215- - User's stated goal (throughput vs latency vs balanced)
216- - Diagnosed issue type
217- - Server's current state
216+ 3. Decide whether to use an existing profile or create a custom one:
217+
218+ **Use existing profile when:**
219+ - A built-in profile closely matches the diagnosed issue
220+ - User wants a conservative, well-tested configuration
221+ - The network situation fits a common pattern (Type A or B)
222+
223+ **Create custom profile when:**
224+ - Existing profiles don't address the specific issue
225+ - User has special requirements (e.g., specific buffer sizes, particular qdisc)
226+ - Fine-tuned parameters are needed based on measured BDP
227+ - Combining settings from multiple profiles would be beneficial
218228
219229Profile selection guidelines:
220230- For Type A issues: Start with `bbr-fq-tuned-32mb` (increased buffers)
221231- For Type B issues: Start with `bbr-fq-default` (conservative, with FQ qdisc)
222- - For high-BDP links (high bandwidth × high RTT): Prefer larger buffer profiles
232+ - For high-BDP links (high bandwidth × high RTT): Prefer larger buffer profiles or create custom with calculated buffer sizes
223233- For low-latency requirements: Prefer profiles without aggressive buffering
224234
235+ ### Creating Custom Profiles
236+
237+ When creating a custom profile with `nettune.create_profile`, follow these guidelines:
238+
239+ **Risk Level Selection:**
240+ - `low`: Only safe, widely-tested settings (e.g., enabling BBR, basic FQ)
241+ - `medium`: Moderate buffer increases, standard optimizations
242+ - `high`: Aggressive tuning, large buffers, experimental settings
243+
244+ **Sysctl Parameter Guidelines:**
245+
246+ | Parameter | Purpose | Conservative | Aggressive |
247+ |-----------|---------|--------------|------------|
248+ | `net.core.rmem_max` | Max receive buffer | 16MB | 64MB+ |
249+ | `net.core.wmem_max` | Max send buffer | 16MB | 64MB+ |
250+ | `net.ipv4.tcp_rmem` | TCP receive buffer (min/default/max) | "4096 131072 16777216" | "4096 524288 67108864" |
251+ | `net.ipv4.tcp_wmem` | TCP send buffer (min/default/max) | "4096 65536 16777216" | "4096 524288 67108864" |
252+ | `net.ipv4.tcp_congestion_control` | Congestion algorithm | bbr | bbr |
253+ | `net.ipv4.tcp_mtu_probing` | MTU discovery | 1 | 1 |
254+ | `net.ipv4.tcp_slow_start_after_idle` | Slow start behavior | 1 (safe) | 0 (better for persistent connections) |
255+
256+ **Buffer Size Calculation (for high-BDP links):**
257+ ```
258+ Required buffer = Bandwidth (bytes/sec) × RTT (seconds) × 2
259+ Example: 1 Gbps link with 100ms RTT = 125MB/s × 0.1s × 2 = 25MB
260+ ```
261+
262+ **Qdisc Selection:**
263+ - `fq` (Fair Queue): Best for BBR, provides flow isolation
264+ - `fq_codel`: Good for reducing bufferbloat, AQM built-in
265+ - `cake`: Advanced shaping, good for limited bandwidth scenarios
266+ - `pfifo_fast`: Default, minimal processing overhead
267+
225268### Phase 4: Safe Application
226269
2272701. **Create Snapshot**: Call `nettune.snapshot_server` BEFORE any changes
@@ -277,6 +320,13 @@ Provide a summary including:
277320- Compare latency during load vs baseline
278321- RTT inflation > 2x suggests buffering issues
279322
323+ ### nettune.create_profile
324+ - Use when existing profiles don't match the diagnosed issue
325+ - Calculate buffer sizes based on measured bandwidth × RTT × 2
326+ - Start with `risk_level: "medium"` unless you have specific reasons
327+ - Always include a clear description explaining the profile's purpose
328+ - For high-BDP scenarios, set appropriate tcp_rmem/tcp_wmem based on BDP calculation
329+
280330### nettune.apply_profile
281331- ALWAYS use dry_run first
282332- ALWAYS set auto_rollback_seconds for commit
@@ -317,11 +367,12 @@ When recommending changes:
3173671 . Runs baseline tests (status, RTT, throughput, latency-under-load)
3183682 . Analyzes results and classifies the issue
3193693 . Lists and reviews available profiles
320- 4 . Creates a snapshot
321- 5 . Does a dry-run and explains proposed changes
322- 6 . After user approval, commits with auto-rollback
323- 7 . Re-runs tests and compares results
324- 8 . Provides a comprehensive summary
370+ 4 . Selects an existing profile OR creates a custom profile based on diagnosis
371+ 5 . Creates a snapshot
372+ 6 . Does a dry-run and explains proposed changes
373+ 7 . After user approval, commits with auto-rollback
374+ 8 . Re-runs tests and compares results
375+ 9 . Provides a comprehensive summary
325376
326377## Troubleshooting
327378
0 commit comments