Nâng CaoNode.js iconNode.js

Database connection pooling quan trọng thế nào?

Tạo pool connections sẵn, tái sử dụng thay vì mở/đóng mỗi query.

js
new Pool({ max: 20, idleTimeoutMillis: 30000 })

Không có pooling: mỗi request mở connection mới → chậm, exhaust DB connections.

  • Prisma, Sequelize tự quản lý pool.
  • Monitor: active/idle/waiting connections.

Xem toàn bộ Node.js cùng filter theo level & chủ đề con.

Mở danh sách Node.js