К основному содержанию
скилл CX Codex

nginx-c-module-perf — скилл для Claude Code: настройка и установка

Скилл nginx-c-module-perf даёт рекомендации по производительности и отказоустойчивости модулей nginx на C. Пригодится при настройке буферов, соединений, кэша и обработки ошибок.

MIT 267 установок ★ 227 обновлён 2026-08-15

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add pproenca/dot-skills --skill nginx-c-module-perf -a claude-code
Открыть на GitHub

Что делает nginx-c-module-perf

Внутри — 43 правила из руководства по разработке nginx, распределённые по восьми категориям. Они охватывают буферы и zero-copy I/O, соединения, блокировки общей памяти, восстановление после ошибок, тайм-ауты и повторы, кэширование, работу воркеров, логи и метрики.

Используйте скилл, когда меняете модуль nginx на C и хотите проверить влияние решений на задержки, пропускную способность или память. Он дополняет nginx-c-modules: тот скилл посвящён корректности, включая безопасность памяти и жизненный цикл запроса. Здесь фокус на производительности и эксплуатационной надёжности, поэтому вопросы корректности стоит проверять отдельно.

Какие задачи решает

  • сократить копирование буферов в цепочке фильтров
  • настроить повторное использование соединений
  • уменьшить конкуренцию за блокировки общей памяти
  • обработать сбои upstream и нехватку памяти
  • разделить тайм-ауты соединения, отправки и чтения

Примеры запросов агенту

  • Проверь модуль nginx на C: где можно сократить копирование буферов?
  • Подскажи, как уменьшить конкуренцию воркеров за общую память в этом модуле.
  • Разбери обработку сбоев upstream и стратегию повторных попыток.

Как установить nginx-c-module-perf

1Через Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill nginx-c-module-perf -a claude-code

2Вручную: положить файлы

~/.claude/skills/nginx-c-module-perf/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/nginx-c-module-perf/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о nginx-c-module-perf

Как установить nginx-c-module-perf в Claude Code?

Выполните npx skills add pproenca/dot-skills --skill nginx-c-module-perf -a claude-code. Файл скилла появится по пути ~/.claude/skills/nginx-c-module-perf/SKILL.md.

Что делает nginx-c-module-perf?

Даёт правила для повышения производительности и эксплуатационной надёжности модулей nginx на C: от работы с буферами до кэширования и логирования.

Чем nginx-c-module-perf отличается от nginx-c-modules?

nginx-c-module-perf рассматривает производительность и надёжность при эксплуатации. nginx-c-modules посвящён корректности, в том числе безопасности памяти и жизненному циклу запроса.

Исходный текст

SKILL.md · MIT
---
name: nginx-c-module-perf
description: 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.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](../nginx-c-modules/SKILL.md) 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`](references/buf-chain-reuse.md) - Reuse Buffer Chain Links Instead of Allocating New Ones
- [`buf-file-sendfile`](references/buf-file-sendfile.md) - Use File Buffers for Static Content Instead of Reading into Memory
- [`buf-avoid-copy`](references/buf-avoid-copy.md) - Avoid Copying Buffers When Passing Through Filter Chain
- [`buf-coalesce-small`](references/buf-coalesce-small.md) - Coalesce Small Buffers Before Output
- [`buf-shadow-reference`](references/buf-shadow-reference.md) - Use Shadow Buffers for Derived Data Instead of Full Copies
- [`buf-recycled-flag`](references/buf-recycled-flag.md) - Mark Buffers as Recycled for Upstream Response Reuse

### 2. Connection Efficiency (CRITICAL)

- [`conn-reusable-queue`](references/conn-reusable-queue.md) - Mark Idle Connections as Reusable for Pool Recovery
- [`conn-drain-pressure`](references/conn-drain-pressure.md) - Handle Connection Drain Under Memory Pressure
- [`conn-tcp-nodelay`](references/conn-tcp-nodelay.md) - Control TCP_NODELAY for Latency-Sensitive Responses
- [`conn-prealloc-pool`](references/conn-prealloc-pool.md) - Size Connection Pool to Avoid Runtime Reallocation
- [`conn-close-linger`](references/conn-close-linger.md) - Use Lingering Close for Graceful Connection Shutdown
- [`conn-ssl-session-reuse`](references/conn-ssl-session-reuse.md) - Enable SSL Session Caching in Upstream Connections

### 3. Lock Contention & Atomics (HIGH)

- [`lock-minimize-critical`](references/lock-minimize-critical.md) - Minimize Critical Section Duration in Shared Memory
- [`lock-atomic-counters`](references/lock-atomic-counters.md) - Use Atomic Operations for Simple Counters Instead of Mutex
- [`lock-trylock-fallback`](references/lock-trylock-fallback.md) - Use ngx_shmtx_trylock with Fallback to Avoid Worker Stalls
- [`lock-per-worker-aggregate`](references/lock-per-worker-aggregate.md) - Aggregate Per-Worker Counters to Reduce Shared Memory Access
- [`lock-alloc-outside`](references/lock-alloc-outside.md) - Perform Slab Allocation Outside Hot Path
- [`lock-rw-pattern`](references/lock-rw-pattern.md) - Use Read-Copy-Update Pattern for Read-Heavy Shared Data

### 4. Error Recovery & Resilience (HIGH)

- [`err-cache-errno`](references/err-cache-errno.md) - Cache ngx_errno Immediately to Prevent Overwrite
- [`err-fallback-response`](references/err-fallback-response.md) - Return Fallback Response When Upstream Fails
- [`err-resource-exhaustion`](references/err-resource-exhaustion.md) - Handle Pool and Slab Allocation Exhaustion Gracefully
- [`err-blocked-counter`](references/err-blocked-counter.md) - Use Blocked Counter to Prevent Premature Request Destruction
- [`err-connection-error-check`](references/err-connection-error-check.md) - Check Connection Error Flag Before I/O Operations
- [`err-log-once-pattern`](references/err-log-once-pattern.md) - Limit Repeated Error Logging to Prevent Log Storms

### 5. Timeout & Retry Strategy (MEDIUM-HIGH)

- [`timeout-upstream-phases`](references/timeout-upstream-phases.md) - Set Separate Timeouts for Connect, Send, and Read Phases
- [`timeout-retry-next-upstream`](references/timeout-retry-next-upstream.md) - Configure next_upstream Mask for Retriable Failures
- [`timeout-backoff-reconnect`](references/timeout-backoff-reconnect.md) - Use Exponential Backoff for Upstream Reconnection Attempts
- [`timeout-client-body-limit`](references/timeout-client-body-limit.md) - Set Client Body Timeout to Bound Slow-Client Resource Usage

### 6. Response Caching (MEDIUM)

- [`cache-shm-lru`](references/cache-shm-lru.md) - Implement LRU Eviction in Shared Memory Cache Zones
- [`cache-stampede-lock`](references/cache-stampede-lock.md) - Prevent Cache Stampede with Single-Flight Pattern
- [`cache-key-hash`](references/cache-key-hash.md) - Use ngx_hash for Fixed Cache Key Lookups
- [`cache-ttl-atomic`](references/cache-ttl-atomic.md) - Use Atomic Timestamp Comparison for TTL Expiry Checks
- [`cache-conditional-store`](references/cache-conditional-store.md) - Cache Only Successful Responses to Avoid Negative Cache Pollution

### 7. Worker & Process Tuning (MEDIUM)

- [`worker-accept-mutex`](references/worker-accept-mutex.md) - Understand Accept Mutex Impact on Connection Distribution
- [`worker-connection-prealloc`](references/worker-connection-prealloc.md) - Use Pre-Allocated Free List for Module Data Structures
- [`worker-graceful-shutdown`](references/worker-graceful-shutdown.md) - Handle Worker Shutdown Signal Without Data Loss
- [`worker-single-process-debug`](references/worker-single-process-debug.md) - Support Single-Process Mode for Debugging
- [`worker-cycle-conf`](references/worker-cycle-conf.md) - Access Configuration Through Cycle for Process-Level Operations

### 8. Logging & Metrics (LOW-MEDIUM)

- [`log-level-guard`](references/log-level-guard.md) - Guard Expensive Debug Argument Computation Behind Level Check
- [`log-connection-context`](references/log-connection-context.md) - Attach Module Context to Connection Log for Tracing
- [`log-shared-metrics`](references/log-shared-metrics.md) - Collect Metrics via Shared Memory Counters
- [`log-error-dedup`](references/log-error-dedup.md) - Deduplicate Repeated Error Messages with Throttling
- [`log-action-string`](references/log-action-string.md) - Set Log Action String for Operation Context

## How to Use

Read individual reference files for detailed explanations and code examples:

- [Section definitions](references/_sections.md) - Category structure and impact levels
- [Rule template](assets/templates/_template.md) - Template for adding new rules

## Reference Files

| File | Description |
|------|-------------|
| [references/_sections.md](references/_sections.md) | Category definitions and ordering |
| [assets/templates/_template.md](assets/templates/_template.md) | Template for new rules |
| [metadata.json](metadata.json) | Version and reference information |

© pproenca · MIT · pproenca/dot-skills

Похожие скиллы

Все скиллы по теме «DevOps и инфраструктура» →
nginx-configuration aj-geddes Скилл nginx-configuration для Nginx на Claude Code: реверс-прокси, балансировка нагрузки, SSL/TLS, кэш и API-шлюз. Настраивает типовые конфиги без обращения к документации. CX Codex +1 1 500установок nginx-config-optimizer patricio0312rev Скилл nginx-config-optimizer для Claude Code, Codex, Cursor и других агентов, который генерирует оптимизированные конфигурации Nginx. Покрывает обратный прокси, балансировку нагрузки, SSL/TLS, кэширование и rate limiting. CX Codex +1 457установок nginx-expert PCL Team Скилл nginx-expert помогает настроить Nginx, выставить reverse proxy, настроить кеширование и TLS. Скилл пригодится при подготовке веб-сервера к продакшену. CX Codex +1 451установок nginx membrane Скилл подключает агента к NGINX через Membrane CLI для управления конфигурациями, логами и выполнения вызовов через прокси. CX Codex +1 186установок alibabacloud-nginx-ingress-to-api-gateway aliyun Скилл alibabacloud-nginx-ingress-to-api-gateway переносит Kubernetes nginx Ingress в Alibaba Cloud API Gateway. Анализирует YAML локально, классифицирует аннотации, генерирует конфигурацию Higress и отчёт о миграции. CX Codex +1 152установок terraform-module-library Seth Hobson Скилл terraform-module-library для Claude Code, помогающий писать переиспользуемые модули Terraform под AWS, Azure, GCP и OCI. Структурирует модули, предлагает готовые шаблоны и задаёт правила версионирования, валидации и тестирования. CX Codex +1 15 615установок

Из того же набора139

Весь набор →
rails-design-system Скилл rails-design-system с 51 правилом построения дизайн-системы в Rails. Когда создавать партиалы, компоненты, хелперы, Turbo Frames и Stimulus-контроллеры. CX Codex +1 276установок ios-navigation Скилл ios-navigation задаёт строгие правила навигации SwiftUI для модульной архитектуры MVVM-C на Swift 6.2. Помогает проектировать переходы, диплинки и модальные экраны. CX Codex +1 275установок swift-data Помогает проектировать слой данных на SwiftData в модульных приложениях на iOS 26 и Swift 6.2. Используйте его при работе с моделями, репозиториями и синхронизацией. CX Codex +1 275установок ios-chaos-monkey Скилл ios-chaos-monkey для Claude Code содержит правила и TDD-сценарии для выявления крашей и гонок данных в iOS на Swift 6.2. CX Codex +1 274установок react-native-elements Скилл подсказывает, как применять React Native Elements: настраивать темы, выбирать компоненты и собирать производительные списки. Пригодится при разработке и проверке React Native-приложений. CX Codex +1 265установок bug-review Скилл bug-review для Claude Code выполняет пять параллельных проходов по диффу PR, отбирает находки большинством голосов и проверяет их отдельным валидатором на Opus. Баги выявляются до мержа. CX Codex +1 264установок effect-ts Скилл с рекомендациями и шаблонами по библиотеке Effect-TS в TypeScript: типизированные ошибки, сервисы через Layer и генераторы Effect.gen. CX Codex +1 263установок nginx-c-module-debug Скилл nginx-c-module-debug для Claude Code помогает разбирать падения nginx C-модулей, ошибки памяти и сбои в потоке запросов. Для диагностики используются GDB, core dump и трассировка. CX Codex +1 260установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой