简体   繁体   English

使用mongoose驱动程序在mongodb中进行并发请求的nodejs中,一个连接是否足够?

[英]Is one connection is enough in nodejs using mongoose driver for concurrent request in mongodb?

Is it possible to have one single connection poolsize { poolSize: 1 } for multiple and concurrent webservice hit in mongodb mongodb中是否可能有一个连接池大小{poolSize:1}用于多个并发Web服务

Will it reuse the connection or will throw any exception 它会重用连接还是抛出任何异常

I'm Using mongoose driver in nodejs and mongoDB as database. 我在nodejs和mongoDB中使用mongoose驱动程序作为数据库。

It will reuse the connection, but it will slow down your database calls, as there is a limit of only one active connection to the database. 它将重用该连接,但是会降低数据库调用的速度,因为到数据库只有一个活动连接的限制。 This will cause issues when you scale up to higher loads. 当您扩展到更高的负载时,这将导致问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM