Help for owners
My website goes offline again and again
Short answer
Repeated outages usually come from a few causes: the server running out of memory or disk, a process that crashes and is not restarted, an expired certificate, or a spike in visitors. Note the times it fails, ask your host for the server logs, and do not rebuild anything until the cause is known.
Does this sound like your situation?
- The site is down every few days, then comes back by itself or after a restart.
- It fails at the same time each day, often at night.
- Visitors see a 502, 503 or 504 error or a security warning.
- My developer restarts it and says it is fixed.
- I only hear about it from customers.
Why does this happen?
The program behind the site crashes
The web server answers visitors, but the app behind it can stop. The visitor then sees a bad gateway error.
Technical detail: nginx 502 Bad Gateway in front of a Node.js app
The server is out of memory or a limit
Amazon documents that instance status checks fail on problems such as exhausted memory, a corrupted file system or incorrect startup configuration, and that these typically need you to fix them, for example by rebooting.
Confirmed by docs.aws.amazon.com
The underlying machine has a fault
AWS says system status checks detect problems such as loss of network connectivity or power or hardware issues on the physical host, which need AWS involvement. For instances backed by EBS you can stop and start the instance, which in most cases moves it to a new host.
Confirmed by docs.aws.amazon.com
The security certificate was not renewed
Let's Encrypt certificates are valid for 90 days by default, and the project recommends renewing them every 60 days. If automatic renewal fails, browsers warn visitors away.
Confirmed by letsencrypt.orgTechnical detail: A Let's Encrypt certificate did not renew with Certbot
A slow request holds everything up
When one part waits too long, the front server gives up and shows a timeout error.
Technical detail: nginx gives up waiting for the app and returns 504
What can I do about it today?
- Write down every outageDate, time, how long, what error visitors saw and what brought it back.
- Set up free outside monitoringA simple uptime checker that emails you when the site stops answering means you hear first, and gives you exact times.
- Ask your host or developer for the logsRequest the server logs for the minutes before each outage. Do not ask them to wipe or rebuild anything.
- Check the certificate datesClick the padlock in the browser and read the expiry date.
- Do not keep restarting as the planA restart hides the cause, so the outage returns.
When should I bring someone in?
- It has happened more than once.
- The outages cost orders or bookings.
- Nobody can tell you the cause from logs.
How do I handle it?
- Back up firstA backup is taken before any change to the live server.
- Find the cause in the evidenceLogs, memory and disk use, certificate renewal and the host's status checks for the failure times.
- Fix the cause and add a safety netRestart-on-failure, an alert to you, and renewal checks, so a repeat is short and known.
- Have a tested rollbackAny change I make has a way back that I have tested.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Is it my hosting company?
Sometimes. The host's status checks and logs show whether the machine or your own program failed.
Will a bigger server fix it?
Only if it ran out of memory or capacity. A crash loop or an expired certificate is not fixed by size.
Can I be told before it happens?
An uptime alert tells you within minutes of an outage. It does not prevent one.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.
For your developer: the technical fixes
502 Bad Gatewaynginx 502 Bad Gateway in front of a Node.js app504 Gateway Time-outnginx gives up waiting for the app and returns 504Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:A Let's Encrypt certificate did not renew with CertbotFatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)PHP Fatal error: Allowed memory size of 134217728 bytes exhaustedJob for mariadb.service failed because a timeout was exceeded.systemctl start mariadb hangs, then fails with a timeout