Help for owners
My website gets slow or crashes when many visitors arrive
Short answer
A site slows under load when one part reaches its limit: the server's memory or processor, the number of connections, or the database. Buying a bigger server helps only if that part is the limit. Find the bottleneck with a measured test before the next campaign.
Does this sound like your situation?
- The site is fine most days but crawls during a campaign or sale.
- Visitors see errors or timeouts at busy hours.
- The server needs a restart after a peak.
- A bigger plan did not help.
Why does this happen?
The server runs out of memory or processing power
When too many people use the site at once, the server may use all its memory and start failing.
The database is the bottleneck
Pages that run many database queries slow down together under load.
Technical detail: A statement waited for a lock held by another transaction and gave up (error 1205)
Everything is generated for every visitor
If the same page is rebuilt for each visitor, a cache can serve the repeat visits and takes load off the application.
Limits on connections and files
Servers have limits on open connections and files, and they fail suddenly when reached.
Technical detail: Node.js crashes with EMFILE: too many open files
What can I do about it today?
- Tell your developer the dates of the peaksCampaigns, newsletters and sales explain most spikes. Share the dates and times.
- Do not wait for the next campaign to testAsk for a controlled load test on a quiet day, not in the middle of a launch.
- Do not buy a bigger plan in a panicIt costs more and may not remove the real limit. Ask what is the first part that fails.
- Reduce the pressure before the next peakAsk whether heavy tasks such as reports and imports can wait until after the event.
- Write down what failed last timeThe errors, the pages and the times. They are the best clue.
When should I bring someone in?
- A launch, sale or campaign is coming.
- The site goes down every time traffic rises.
- You are not sure whether the problem is the server, the code or the database.
How do I handle it?
- Measure firstI look at graphs and logs from the last peak, and I run a controlled test on a copy to see which part gives out first.
- Fix the first limitI remove that bottleneck, whether it is a query, a cache or a setting, then test again, since the next limit appears.
- Choose the right sizeI recommend a server size from the measurements, not from guesswork.
- Prepare for the next peakI write a short checklist and add alerts for the days that matter.
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?
Do I need to move to the cloud?
Not necessarily. First I find the limit; moving is only worthwhile if the current setup cannot be improved.
Can you say the site will survive a campaign?
I cannot promise it. I test, fix what the measurements show and tell you the limits.
Is it a hacking attack?
Sometimes. I check the logs for suspicious patterns, because the response is different from a normal busy day.
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
504 Gateway Time-outnginx gives up waiting for the app and returns 504502 Bad Gatewaynginx 502 Bad Gateway in front of a Node.js appError: EMFILE: too many open files, open '/path/to/file'Node.js crashes with EMFILE: too many open filesERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transactionA statement waited for a lock held by another transaction and gave up (error 1205)