Scale application nodejs in Digitalocean

0

I try to do the following: I have 1 form with some fields, this can upload files (photos, documents, etc.) It is simple, and this is then displayed in a list of files in another view with a short description. When I did it using a single node as a server, there was no problem because I used multer to receive the files and fs to rename them and filter them according to a pattern.

app.post("/archivo", upload.single('archivo'), filtro, (req, res) => {
    console.log(req.file);
    fs.rename(req.file.path, "./filtrado/" + req.file.originalname);
...... ................... ..

The issue is that my application has to have 20k of concurrent users , I've been doing some tests with Apache ab, using 4 nodes of 1gb in Digitalocean with Nginx of reverse proxy and I see that it supports around 7k (this only in the view that shows the files, I need to test the form)

I followed the tutorials of digitalocean, in each dopplet I created an instance of my application and I balance it with Nginx, with 1 instance it went up to 800, with 2 up to 2000, with 3 up to 3000-4000 and with 4 up to 7k, It is obvious that I need to continue climbing horizontally, but according to your experience, what would be a recommended way to do this? So the code in is small, there's nothing to optimize, I run it in production mode, I do not use Gzip or compression as Nginx already uses.

And with regard to the separate load test, I am not an expert on it because I never worry about it until now, but since I could do a complete test on my application, the tutorials are very limited in that regard. and apart from Apache ab which they would recommend me, thank you in advance.

    
asked by Kevin AB 03.01.2017 в 09:25
source

0 answers