nginx-c-module-perf
БесплатноБез исполняемых скриптовНе проверенnginx C module performance optimization and reliability guidelines based on the official nginx development guide. This skill should be used when optimizing…
от pproenca★ 231 звезда на GitHubОб этом скилле
nginx.org C Module Performance & Reliability Best Practices
Comprehensive performance optimization and reliability guide for nginx C modules, derived from the official nginx development documentation and production engineering experience. Contains 43 rules across 8 categories, prioritized by impact to guide automated optimization and resilience improvements.
Companion skill: This skill complements nginx-c-modules which covers correctness (memory safety, request lifecycle, configuration). This skill covers performance optimization and operational reliability.
When to Apply
Reference these guidelines when:
- Optimizing nginx C module throughput and latency
- Reducing buffer copies and enabling zero-copy I/O paths
- Tuning connection pooling and socket options
- Minimizing shared memory lock contention across workers
- Implementing graceful error recovery and fallback responses
- Configuring upstream timeouts and retry strategies
- Building in-module response caches with shared memory
- Tuning worker process behavior under load
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Buffer & Zero-Copy I/O | CRITICAL | buf- |
| 2 | Connection Efficiency | CRITICAL | conn- |
| 3 | Lock Contention & Atomics | HIGH | lock- |
| 4 | Error Recovery & Resilience | HIGH | err- |
| 5 | Timeout & Retry Strategy | MEDIUM-HIGH | timeout- |
| 6 | Response Caching | MEDIUM | cache- |
| 7 | Worker & Process Tuning | MEDIUM | worker- |
| 8 | Logging & Metrics | LOW-MEDIUM | log- |
Quick Reference
1. Buffer & Zero-Copy I/O (CRITICAL)
buf-chain-reuse- Reuse Buffer Chain Links Instead of Allocating New Onesbuf-file-sendfile- Use File Buffers for Static Content Instead of Reading into Memorybuf-avoid-copy- Avoid Copying Buffers When Passing Through Filter Chainbuf-coalesce-small- Coalesce Small Buffers Before Outputbuf-shadow-reference- Use Shadow Buffers for Derived Data Instead of Full Copiesbuf-recycled-flag- Mark Buffers as Recycled for Upstream Response Reuse
2. Connection Efficiency (CRITICAL)
conn-reusable-queue- Mark Idle Connections as Reusable for Pool Recoveryconn-drain-pressure- Handle Connection Drain Under Memory Pressureconn-tcp-nodelay- Control TCP_NODELAY for Latency-Sensitive Responsesconn-prealloc-pool- Size Connection Pool to Avoid Runtime Reallocationconn-close-linger- Use Lingering Close for Graceful Connection Shutdownconn-ssl-session-reuse- Enable SSL Session Caching in Upstream Connections
3. Lock Contention & Atomics (HIGH)
lock-minimize-critical- Minimize Critical Section Duration in Shared Memorylock-atomic-counters- Use Atomic Operations for Simple Counters Instead of Mutexlock-trylock-fallback- Use ngx_shmtx_trylock with Fallback to Avoid Worker Stallslock-per-worker-aggregate- Aggregate Per-Worker Counters to Reduce Shared Memory Accesslock-alloc-outside- Perform Slab Allocation Outside Hot Pathlock-rw-pattern- Use Read-Copy-Update Pattern for Read-Heavy Shared Data
4. Error Recovery & Resilience (HIGH)
err-cache-errno- Cache ngx_errno Immediately to Prevent Overwriteerr-fallback-response- Return Fallback Response When Upstream Failserr-resource-exhaustion- Handle Pool and Slab Allocation Exhaustion Gracefullyerr-blocked-counter- Use Blocked Counter to Prevent Premature Request Destructionerr-connection-error-check- Check Connection Error Flag Before I/O Operationserr-log-once-pattern- Limit Repeated Error Logging to Prevent Log Storms
5. Timeout & Retry Strategy (MEDIUM-HIGH)
timeout-upstream-phases- Set Separate Timeouts for Connect, Send, and Read Phasestimeout-retry-next-upstream- Configure next_upstream Mask for Retriable Failurestimeout-backoff-reconnect- Use Exponential Backoff f
Установить nginx-c-module-perf в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nginx-c-module-perf?
nginx C module performance optimization and reliability guidelines based on the official nginx development guide. This skill should be used when optimizing nginx C modules for throughput, latency, memory efficiency, and operational resilience. Triggers on tasks involving buffer optimization, connection tuning, shared memory contention, error recovery, timeout strategy, caching implementation, worker process tuning, or logging performance in nginx C modules.
Как установить скилл nginx-c-module-perf?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nginx-c-module-perf запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic