How to determine what is causing my node server with nginx to crash at high request rate?
We are developing a SaaS product which is an easy to use invoicing software. We are using React for the frontend app and Node (with fastify web framework and sequelize as ORM) for developing a RESTful API service. For the Database we are using PostgreSQL. We are following a multi-tenant Database architecture, where every tenant will have a separate database. We want to develop the RESTful API server so that it can handle around 500 requests per second. Each request to the REST API will give around 2.1 requests to Postgres.
To make sure that we have enough connections to handle requests from multiple users, we are increasing the max_connections in PG to around 2000.
We are using nginx as a reverse proxy to handle requests to our RESful APIs.