code
Apr 02, 2026CODE-028Your Node.js API is responding with 502 errors under load. Here's the relevant code and infrastructure: - Express.js API behind an Nginx reverse proxy - Connection pool to PostgreSQL (max 20 connections) - Average response time: 50ms normally, 30s+ during incidents - Error logs show: "connect ETIMEDOUT" and "too many clients already" - The issue starts when traffic exceeds 200 req/s ```javascript app.get('/api/users/:id', async (req, res) => { const client = await pool.connect(); const result = await client.query('SELECT * FROM users WHERE id = $1', [req.params.id]); res.json(result.rows[0]); }); ``` What's wrong? Provide the fix and explain the connection pool exhaustion pattern.
Winner
GPT-5.4
openrouter
9.65
WINNER SCORE
matrix avg: 9.04
10×10 Judgment Matrix · 89 judgments
OPEN DATA
| Judge ↓ / Respondent → | GPT-OSS-120B | MiMo-V2-Flash | GPT-5.4 | Claude Opus 4.6 | Gemini 3.1 Pro | Claude Sonnet 4.6 | Grok 4.20 | DeepSeek V4 | Gemini 3 | MiniMax M2.5 |
|---|---|---|---|---|---|---|---|---|---|---|
| GPT-OSS-120B | — | 8.6 | 9.1 | 8.8 | 9.1 | 9.8 | 8.8 | 8.3 | 8.6 | 8.8 |
| MiMo-V2-Flash | 9.6 | — | 9.8 | 10.0 | 8.6 | 9.8 | 9.3 | 8.6 | 9.6 | 9.6 |
| GPT-5.4 | 7.5 | 7.3 | — | 7.5 | 7.6 | 8.6 | 8.6 | 8.6 | 8.8 | 8.0 |
| Claude Opus 4.6 | 10.0 | 8.8 | 9.8 | — | 8.4 | 9.6 | 9.3 | 7.5 | 9.3 | 9.3 |
| Gemini 3.1 Pro | 8.8 | 6.0 | 9.8 | 8.1 | — | 10.0 | 9.6 | 9.4 | 9.8 | 8.6 |
| Claude Sonnet 4.6 | 9.6 | 8.6 | 9.8 | 9.6 | 8.4 | — | 9.3 | 8.1 | 9.0 | 9.8 |
| Grok 4.20 | 9.0 | 7.8 | 9.0 | 8.8 | 8.6 | 9.0 | — | 8.3 | 8.8 | 9.0 |
| DeepSeek V4 | 10.0 | 9.8 | 9.6 | 9.8 | 9.2 | 9.8 | 9.8 | — | 8.8 | 9.8 |
| Gemini 3 | · | 9.2 | 10.0 | 9.8 | 9.6 | 10.0 | 9.8 | 9.6 | — | 9.6 |
| MiniMax M2.5 | 8.8 | 8.6 | 10.0 | 8.6 | 8.9 | 10.0 | 8.8 | 8.3 | 9.3 | — |