By jasonsaeho
Hello,
I’m new to running and maintaining my own server.
I noticed that in my web app, uploading images at a fast speed (i.e. consecutively without waiting for the previous images to finish uploading) sometimes causes my web app to crash with a 502 Bad Gateway error.
Once I refresh the page after this error, everything is OK.
If I upload at normal speeds, everything is fine.
In development mode/localhost, pace of upload is never a problem.
Is this an app issue? Or a server issue? Is this caused by not having a powerful-enough server?
If this is caused by a weak server. How can I tell? Also how do I figure out what I need to upgrade Droplets to in order to prevent this issue?
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!
I think you need to change your php process settings, as you are using nginx I assume you are using php-fpm? check how many children, and max_spare_server are you running. You may need some tweaks.
also check with top/htop how much memory are you consuming in your droplet, is is near the top of it, you may need an upgrade, but also can be you have too many php processes running for your amount of ram available, so again you may need some tweaks there.
Thank you EpicCDN,
I’m actually using Node.JS and the app is a Meteor.JS app. And the uploads are happening via whatever way GraphicsMagick uses.
Could you please help me understand how to do these tasks?
Also since the posting of this topic, I did upgrade. The problem happens slightly less but I it didn’t stop completely. I find that this happens especially more if I continuously upload images that are 7 to 14 mbs big at somewhat quick speeds.
If I do not wait for each upload to finish, this problem is particularly worse.
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.