Question

Ghost droplet 502s on large images

My ghost blog works great on most articles but on one high traffic article with large images, it 502’s when it has more than 16 ish large screenshots.

There is no error log. It’s all very strange. I thought it might be just me, but it goes down everywhere.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

@rawsh

You should be able to run tail on the NGINX error log to see what’s being logged:

tail -20 /var/log/nginx/error.log

If nothing is being logged to that file, my first guess would be that the Ghost instance is crashing and since NGINX is unable to proxy the request to the Ghost instance (due to it crashing), it throws 502.

If the app is indeed crashing, it’d most likely due to OOM (Out of Memory). This can happen on 512M droplets where resources are far more constrained than they would be on say, a 1GB or 2GB.

If you can post the output of:

free -mh

That’ll give us a better idea of what’s being used, cached, etc when it comes to RAM.

You can also use top to monitor usage. To sort top, you can use SHIFT+M, c, then e which will sort processes by usage, expand the process commands, and show it in human-readable format. Those are keystrokes you’d use after running top.

Also, for the sake of looking at NGINX’s configuration, can you post the contents of:

/etc/nginx/nginx.conf

Sorry for starting a new answer, but this forum makes it difficult to answer the sub-thread you posted. Well, it’s interesting, because I have been visiting exactly that page (could see your domain in the config) many, many times a couple of hours ago - and did none-cache browser refresh. I could not get it to crash. It looks like it’s just an access log - not the error log, which we could have used for debugging. But don’t you use forever, pm2 or supervisor to control Ghost? Otherwise, how does Nodejs and Ghost automatically start, when you restart your server?

Are you using Nginx as proxy, so it’s serving the files directly or is Nodejs handling everything? It sounds like your Nodejs is crashing or stop accepting more connections. Are you sure there nothing logged anywhere?