mcpField
N
nginx-c-module-perf

nginx-c-module-perf

github.com/pproencaDevelopment218256 installsUpdated 11w ago
Repository

About nginx-c-module-perf

nginx-c-module-perf is a skill with prioritized guidance for improving performance and operational reliability in nginx C modules. It organizes 43 rules into eight categories, with reference files for further explanations and code examples.

Key features

  1. 0143 rules across eight categories
  2. 02Prioritized optimization guidance
  3. 03Buffer and zero-copy I/O practices
  4. 04Connection, lock, and worker tuning
  5. 05Resilience, timeout, and caching patterns

Use cases

  1. 01Reducing buffer copies in module I/O paths
  2. 02Tuning upstream connections and timeouts
  3. 03Improving shared-memory cache and lock behavior
  4. 04Planning recovery for upstream and resource failures

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill nginx-c-module-perf

After installing, type/nginx-c-module-perfin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
buf-avoid-copy.md
buf-chain-reuse.md
buf-coalesce-small.md
buf-file-sendfile.md
buf-recycled-flag.md
buf-shadow-reference.md
cache-conditional-store.md
cache-key-hash.md
cache-shm-lru.md
cache-stampede-lock.md
cache-ttl-atomic.md
conn-close-linger.md
conn-drain-pressure.md
conn-prealloc-pool.md
conn-reusable-queue.md
conn-ssl-session-reuse.md
conn-tcp-nodelay.md
err-blocked-counter.md
err-cache-errno.md
err-connection-error-check.md
err-fallback-response.md
err-log-once-pattern.md
err-resource-exhaustion.md
lock-alloc-outside.md
lock-atomic-counters.md
lock-minimize-critical.md
lock-per-worker-aggregate.md

Details

From the project README

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

PriorityCategoryImpactPrefix
1Buffer & Zero-Copy I/OCRITICALbuf-
2Connection EfficiencyCRITICALconn-
3Lock Contention & AtomicsHIGHlock-
4Error Recovery & ResilienceHIGHerr-
5Timeout & Retry StrategyMEDIUM-HIGHtimeout-
6Response CachingMEDIUMcache-
7Worker & Process TuningMEDIUMworker-
8Logging & MetricsLOW-MEDIUMlog-

Quick Reference

1. Buffer & Zero-Copy I/O (CRITICAL)
2. Connection Efficiency (CRITICAL)
3. Lock Contention & Atomics (HIGH)
4. Error Recovery & Resilience (HIGH)
5. Timeout & Retry Strategy (MEDIUM-HIGH)
6. Response Caching (MEDIUM)
7. Worker & Process Tuning (MEDIUM)
8. Logging & Metrics (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported