Skip to content

Commit 47a9ff7

Browse files
committed
restamos timeouts
1 parent ecb6514 commit 47a9ff7

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,33 @@ NestJS **completamente optimizado** para máximo rendimiento:
4343
### Resultados Completos
4444

4545
#### 🏛️ Comparación Framework vs Framework
46-
| Framework | Runtime | Requests/sec | Transfer/sec | Latencia (avg) | Timeouts | Rank |
47-
|-----------|---------|-------------|--------------|---------------|-----------|------|
48-
| **🥇 Spring Boot + Virtual Threads** | Java 21 | **18,303** | **3.13MB** | 186ms | 8,769 | **** |
49-
| **🥈 NestJS + Fastify** | Node.js | **13,464** | **3.00MB** | 112ms | 1,070 | **** |
50-
| **🥉 Bun Nativo** | Bun (APIs nativas) | **12,471** | **1.96MB** | 154ms | 0 | **** |
51-
| **NestJS + Fastify** | Bun | **12,649** | **2.24MB** | 155ms | 0 ||
52-
| **Spring Boot (Tradicional)** | Java 21 | **3,970** | **695KB** | 156ms | 8,892 ||
46+
| Framework | Runtime | RPS Reportado | Timeouts | **RPS Exitosos** | Latencia | Rank |
47+
|-----------|---------|---------------|----------|------------------|----------|------|
48+
| **🥇 NestJS + Fastify** | **Bun** | 12,649 | 0 | **12,649** | 155ms | **** 🚀 |
49+
| **🥈 NestJS + Fastify** | **Node.js** | 13,464 | 1,070 | **~12,394** | 112ms | ****|
50+
| **🥉 Bun Nativo** | **Bun (APIs nativas)** | 12,471 | 0 | **12,471** | 154ms | **** 🔥 |
51+
| **Spring Boot + Virtual Threads** | Java 21 | 18,303 | 8,769 | **~9,534** | 186ms ||
52+
| **Spring Boot (Tradicional)** | Java 21 | 3,970 | 8,892 | **~-4,922** | 156ms ||
53+
54+
#### ⚠️ **¿Qué son los Timeouts?**
55+
56+
Los **timeouts** son requests que **wrk envió pero no recibió respuesta** dentro del tiempo límite (2 segundos por defecto). Esto indica:
57+
58+
- **🔴 Sobrecarga del servidor**: No puede procesar todas las requests
59+
- **🔴 Thread pool exhausted**: Sin threads disponibles (Java tradicional)
60+
- **🔴 Event loop blocked**: Operaciones bloqueantes (Virtual Threads con sleep)
61+
- **🔴 Conexiones perdidas**: El servidor rechaza conexiones
62+
63+
**Virtual Threads con sleep artificial** causa muchos timeouts porque:
64+
1. **Miles de threads bloqueados** esperando 50ms cada uno
65+
2. **Memory pressure** por tantos threads
66+
3. **Context switching** masivo
67+
4. **GC pressure** por allocations
68+
69+
**NestJS/Bun sin timeouts** significa:
70+
-**Servidor estable** bajo carga
71+
-**Todas las requests procesadas**
72+
-**Sin sobrecarga** del sistema
5373

5474
#### 🚀 Comparación Runtime Puro vs Framework
5575
| Tecnología | Tipo | Requests/sec | Transfer/sec | Latencia (avg) | Timeouts |
@@ -260,11 +280,12 @@ iot-bench/
260280

261281
### 🎯 Insights Clave de Ambos Benchmarks
262282

263-
#### 📊 **Del Benchmark I/O Artificial:**
264-
1. **Virtual Threads dominan** I/O bloqueante masivo (18,303 req/sec)
265-
2. **NestJS compite dignamente**: Solo 26% más lento que Virtual Threads
266-
3. **Framework vs Runtime**: NestJS (13,464) vs Fastify puro (9,514) = +41%
267-
4. **Compatibilidad importa**: Bun + node-sqlite3 = problema masivo
283+
#### 📊 **Del Benchmark I/O Artificial (¡CORREGIDO!):**
284+
1. **🚀 Bun + NestJS GANA**: 12,649 req/sec exitosos (0 timeouts)
285+
2. **⚡ Node.js + NestJS**: ~12,394 req/sec exitosos (pocos timeouts)
286+
3. **😱 Virtual Threads FALLAN**: Solo ~9,534 req/sec exitosos (muchos timeouts)
287+
4. **💡 Los timeouts distorsionan**: RPS reportado ≠ RPS real exitoso
288+
5. **🎯 Estabilidad importa**: 0 timeouts > alto throughput con errores
268289

269290
#### 🚀 **Del Benchmark Realista (¡GAME CHANGER!):**
270291
1. **🥇 Bun DOMINA workloads realistas**: 7,024 req/sec (+202% vs Virtual Threads)

0 commit comments

Comments
 (0)