I’m getting “504 Gateway Timeout” error on the production site, and I know I’m pointing to the server because if I access this route https://165.227.0.69:8080/test I get the expected result.
I ran in this while looking for answers:
I ran the commands described above and got the following results:
total used free shared buff/cache available Mem: 985 190 192 0 602 642 Swap: 0 0 0
Linux 4.15.0-51-generic (ubuntu-s-1vcpu-1gb-sfo2-01) 06/11/19 x86_64 (1 CPU)
14:07:05 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 14:07:05 all 0.31 0.01 0.07 0.28 0.00 0.00 0.01 0.00 0.00 99.33
The first one it’s confusing since it shows that we have as free memory only 190 but then it shows 642 as available? The post said this error could be related to not having enough memory for the server, but how can I be sure about this?
I have 2 html websites and this angular firebase application (which we’re trying to configure with socket.io) running on a 1 GB Memory / 25 GB Disk / SFO2 - Ubuntu 16.04.5 x64 which has been upgraded to 18.04.
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!
Hi,
I had a similar issue. By default the droplets come without a SWAP file so if you run out of RAM there’s no buffer and some processes would get killed.
You could try adding 1GB SWAP file to at least have some buffer. You could follow these steps here:
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
Hope that this helps!
I solved the problem – it wasn’t actually a memory issue at all. it was that the node js server wasn’t secure. I followed this two part tutorial and was able to solve the problem.
I followed this two-part tutorial: https://blog.cloudboost.io/deploying-a-node-js-express-application-on-digital-ocean-part-1-5d5b0cfe0a34
It was also important to specify the transport in the socket.io call as discussed here: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon
I went ahead and added 1GB Swap, and I’m still facing the same issue.
I’ve also upgraded to a 2GB droplet to keep testing the memory issue:
free -m Mem: 1993 118 1532 0 343 1731 Swap: 1023 0 1023
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.