Skip to content

Instantly share code, notes, and snippets.

View jgcmarins's full-sized avatar

João Marins jgcmarins

View GitHub Profile
@jgcmarins
jgcmarins / .env
Last active January 13, 2025 16:51
WordPress setup with docker-compose and traefik
MYSQL_ROOT_PASSWORD=
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=
@jgcmarins
jgcmarins / Dockerfile
Created June 30, 2025 14:32
Node.js Dockerfile for perfomance
FROM node:22.16-alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
RUN rm -rf node_modules && yarn install --production --frozen-lockfile
FROM alpine AS runtime
WORKDIR /app

Node.js API Performance Optimization — Technical Specification

Overview

This document outlines performance optimization best practices for Node.js APIs based on real-world improvements where throughput increased from 100 req/s to 50,000 req/s on the same infrastructure (same machine and database).

No changes were made to:

  • Programming language
  • System architecture

Node.js API Performance Playbook

Goal

Maximize throughput and reduce latency without changing infrastructure.

This playbook documents practical patterns that scaled an API from 100 req/s → 50,000 req/s on the same machine and database.


Keybase proof

I hereby claim:

  • I am jgcmarins on github.
  • I am jgcmarins (https://keybase.io/jgcmarins) on keybase.
  • I have a public key whose fingerprint is 6B33 1D1B 689F 9C88 8EBF F601 9BA7 85ED D05A 90E5

To claim this, I am signing this object: