Question
Why is my default mean app running so slow?
I created a 1gb droplet with the one click app selection of Mean 0.5.0 on Ubuntu 16.04. I bought a domain name and I’m using nginx to create a proxy server that routes to the default mean application under /opt/mean. I navigate to /opt/mean and run npm start to start the web server. When I open the page in the browser it takes up to 25 seconds to load my website. Here is the output from the server when I request the website. When I try to load the page, it gets to the line that requests users.client.service.js and gets stuck there for a really long time before finally loading the page. My guess is that I’m doing something wrong setting up nginx?
info: GET /modules/users/client/services/password-validator.client.service.js 304 0.695 ms - -
info: GET /modules/users/client/services/users.client.service.js 304 0.565 ms - -
info: GET /modules/core/client/views/header.client.view.html 304 0.730 ms - -
info: GET /modules/core/client/views/home.client.view.html 304 0.491 ms - -
I also changed the nginx default file under sites-enabled to the following
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name MYDOMAIN.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://MYIPADDRESS;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×