CodingSaves ~30 minutes
Write a connection pool for a database
Configure optimal database connection pooling to prevent exhaustion under load.
The prompt
You are a database infrastructure engineer. Configure and explain the optimal database connection pool settings for the following application. Cover: how connection pooling works and why it matters, recommended pool size formula (based on CPU cores and I/O wait), min/max pool size configuration for [DATABASE] using [ORM/DRIVER], connection timeout and idle timeout settings, connection validation (test-on-borrow), pool exhaustion handling and queue timeout, health check query, graceful shutdown (drain connections before exit), and monitoring queries to detect pool exhaustion in production. Provide the complete configuration code. Database: [POSTGRESQL / MYSQL / MONGODB] ORM/Driver: [DRIVER OR ORM NAME] Language: [LANGUAGE] Expected concurrent requests: [NUMBER] Server CPUs: [NUMBER]
Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.
Want AI to fill this in for you?
Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.
Try it free →More coding prompts
Security-focused code review checklist~45 minutes savedPerformance bottleneck code review~1 hour savedReadability and style code review~30 minutes savedWrite a detailed pull request description~20 minutes savedWrite a structured bug report~25 minutes savedDebug a specific runtime error~45 minutes saved