Help for owners
My server goes down again and again
Short answer
A server that keeps going down is rarely random. The usual causes are running out of memory or disk space, a program that crashes and restarts in a loop, or a traffic spike on a plan that is too small. Note the times it fails and do not keep rebooting it. Then I read the logs and find what runs out first.
Does this sound like your situation?
- The site or app is offline for a few minutes, then returns without anyone fixing it.
- It goes down at the same time of day, or after an import or a campaign.
- My host restarts it and it works until the next time.
- Visitors see a 502, 503 or 504 error page.
- Logging in to the server is very slow, or not possible, when it is down.
Why does this happen?
The server runs out of memory
When a process needs more memory than the machine has, the system or the program stops it. A PHP site, for example, ends with an error when a script goes over its memory limit, and a busier site or one heavy page can trigger it again and again.
Technical detail: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
The disk is full
Logs, uploads, backups and database files fill a disk slowly, then everything fails at once, including the database.
Technical detail: The Postgres container cannot write postmaster.pid because Docker is out of disk
A program crashes, restarts and crashes again
A service that is set to restart itself hides a real fault: it comes back, fails on the same thing and goes down again. The site looks like it is going on and off.
Technical detail: A Docker container keeps restarting and never stays up
The web server cannot reach the app behind it
The 502 and 504 pages mean the front door is open while the application behind it is dead or too slow to answer.
Technical detail: nginx 502 Bad Gateway in front of a Node.js app
Someone is hammering the server
Automated login attempts and scrapers use up capacity. Constant failed sign-in attempts in the logs are common on any server open to the internet.
Technical detail: Your auth.log is full of Failed password and Invalid user attempts
What can I do about it today?
- Write down every outageDate, start time, how long, and what happened just before: an import, a campaign, a new plugin, a change by someone.
- Stop rebooting as the cureA restart clears memory and hides the evidence. Restart only to get customers back, and note when you did it.
- Ask your host for the resource graphsMost hosts show memory, CPU and disk use over time in their dashboard. Take screenshots of the last days around an outage.
- Check that backups existAsk who takes backups and when the last one was made. Do not delete files or old data to free space on your own.
- Keep your access details ready, not shared in chatKnow who the hosting account belongs to and who can log in, so work can start quickly.
When should I bring someone in?
- It has gone down more than once in a week.
- Orders, bookings or payments are lost when it is down.
- Nobody on your side can log in to the server or read its logs.
How do I handle it?
- Read the evidence before changing anythingI look at system logs, memory and disk use and application errors around each outage to find what ran out or crashed first.
- Back up, then repair one cause at a timeA backup comes before production changes. I change one thing, watch the result and keep a written note, so a change that does not help can be reversed.
- Make failures visibleAlerts for memory, disk and the site itself are set up so you hear about a problem before your customers do.
- Hand over a short written reportYou get the cause, what was changed and what to watch, in plain language. If the server is simply too small, I tell you that with the readings that show it.
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?
Should I upgrade to a bigger server?
Not before you know what runs out. A leak or a full disk will fill a bigger machine too. Sometimes the answer is a larger plan, and then the readings will show it.
My host says everything is fine on their side.
Hosts usually check that the machine is on. Your application can still be crashing inside it, so the application logs are what I read.
Can I fix it by restarting every night?
It can hold a memory leak back for a while, but it does not remove the cause and a crash in the day still happens.
How was this page made?
I drafted this page with AI assistance. It is general guidance for business owners, not advice for your own system. Found a mistake? Tell me.
For your developer: the technical fixes
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)PHP Fatal error: Allowed memory size of 134217728 bytes exhaustedFATAL: could not write lock file "postmaster.pid": No space left on deviceThe Postgres container cannot write postmaster.pid because Docker is out of diskdocker ps shows an uptime of a few seconds that never growsA Docker container keeps restarting and never stays up502 Bad Gatewaynginx 502 Bad Gateway in front of a Node.js app504 Gateway Time-outnginx gives up waiting for the app and returns 504Failed password for invalid user admin from 198.51.100.23 port 40122 ssh2Your auth.log is full of Failed password and Invalid user attempts