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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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?
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.