Error: Getting server timeout

We are using the community edision ( version - mongodb-4.4.3-debian-10-r27)

Case1 : When we trying to deploy 4 - API, all the API is connecting with mongodb.
Case2: When we trying to deploy 8 - API, only 4 API connecting with mongodb other 4 getting timeout error.
Case3: When we trying to deploy -5 API, only 4 API connecting with mongodb other 1 getting timeout error.

Could you please guide me on this, where we need change the functionality.