Is 2 vCPU and 8GB RAM enough for my NestJS + Next.js app with 60 concurrent users?

0
8
Asked By CuriousCoder123 On

I'm looking to deploy a web application using NestJS for the backend and Next.js for the frontend. I'm considering a VPS with the following specifications: 2 vCPU, 8 GB RAM, 100 GB NVMe, and PostgreSQL hosted on the same server. My anticipated traffic is around 50 to 100 users daily, with a peak of approximately 60 concurrent users. I'm planning to implement Nginx as a reverse proxy, use PM2 in cluster mode, and perform basic database optimizations. I'm curious if this VPS will comfortably handle the load, what potential bottlenecks to keep an eye on, and when I should think about scaling my setup further.

5 Answers

Answered By TechieTom On

Honestly, the specs you're considering might be more than enough or not nearly sufficient, depending on how resource-intensive your app is. If your application is mostly client-side heavy, you should be fine. But if you're running complex database queries, it could become a problem. I'd suggest running some load tests to see how it performs under pressure. Watch out for CPU and memory spikes as those can indicate issues.

Answered By CodeNinja90 On

Your plan sounds good for that kind of traffic; 60 concurrent users isn't too demanding. I've personally run similar stack setups on 2 vCPUs and 4GB of RAM without problems. The bigger concern might actually be your database queries rather than CPU or RAM, so ensure you have proper indexing and connection pooling in place.

DataSeeker -

Absolutely! Database performance is key here. Also, consider using PgBouncer for your PostgreSQL to manage connections better, especially under load.

SpeedyQuery -

Good point! It's all about getting the queries optimized so that even with a bunch of concurrent users, the app runs smoothly.

Answered By WebWizard88 On

For your expected traffic and occasional 60 concurrent users, your VPS specs might be more than sufficient unless you're executing very heavy queries. Watch out for the memory usage during peak times with Next.js if you're doing server-side rendering. Also, PM2 cluster mode is a great choice, just remember to set the max old space size for Node.js to prevent high RAM consumption when traffic increases.

Answered By BusyBeeDev On

The specs you mentioned are likely overkill unless your application demands intense computations. The bottleneck would likely arise from Next.js, especially if you're doing server-side rendering with heavy data fetching. Ensure you optimize your database connections, and only worry about scaling when your database usage consistently goes above 70% CPU or RAM usage, but that shouldn't be an issue at your scale.

Answered By DevDude42 On

Lol, you don't need 1GB of ECC memory per user! Joking aside, unless you're pushing the boundaries on the backend, using a CDN (like Cloudflare) can help a lot. This setup can probably handle anywhere from 50k-100k daily visitors with the right optimizations. So for your current expectations, scaling isn't necessary until you're regularly hitting about 500 concurrent users or running into heavy load issues.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.