Ask HN: Server under heavy load. Any downside to this hack?

https://news.ycombinator.com/item?id=6367198
by webvet • 13 years ago
8 31 13 years ago

The server hosting one of our live apps is under high loads and gets into a state where it stops responding to http requests several times a day. These outages last typically anywhere from a few minutes all the way up to half an hour or so.

The major culprit here is MySQL load and we've been working on optimizing this (those interested can refer to my previous thread on this: https://news.ycombinator.com/item?id=6348903).

For now we've found that restarting the httpd and mysqld services brings things back to normal almost immediately.

While we continue to work on a - more elegant - solution, we're thinking of writing a bash/shell script that runs on hourly cron, checks load average (via uptime or /proc/loadavg) and if found higher than a threshold, restarts the services.

Can anyone think of any downside to this (used at least as a temporary measure)?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com