Quote:
Originally Posted by Dirty Dane
Remote or dedicated SQL server is also a good idea if websites and scripts depend heavily on it. Also for security reasons. + external CDN reduce loads, especially if you have bigger files.
|
Only
IF the traffic and load justifies it, after optimizing settings and identifying any really poorly
written queries which run often, and only if you don't mind "wasting" money paying for unused
hardware. Why? Because two servers doubles the chance of failure. Say a single server has
a 15% of hardware failure taking down the site this year. Add another required server and
that roughly doubles the chance of a hardware failure taking down your site because now you
are down if EITHER fails. Instead of a 15% (once every six years), it's now a 30% chance, or
once every 3 years.
Security wise, multiple servers can either double the chance of being hacked, or can greatly
reduce the damage caused by a hack. That depends entirely on the expertise of the person
setting them up. 95% of the time, doubling the amount of hardware simply doubles your
exposure.
Over the next couple of years we plan to put together a framework to fully leverage the power
of a
properly designed redundant cluster, where each server is more secure because
it's locked down to only doing it's assigned tasks, and each is optimized for the tasks it
performs. It
IS possible, but more often than not it's done backwards - reducing overall
performance and increasing exposure to risk.
One perfect example of how it's often done wrong is that often people set up one server doing MySQL only and the other server doing everything else, primarily serving pics and videos on
the web site, and they expect better performance. In fact, that's a performance killer and a
waste of money. The SQL server uses the CPU, with minimal disk access - virtually no disk
access if it has enough RAM. On the other hand, the web server, spitting out video files,
loads the disk and uses almost no CPU. Splitting the two onto separate servers doesn't
reduce overall load at all - it just means you now have one server that's CPU bound with
an idle hard drive and another server that's drive bound with an idle CPU - waste. Putting
them on the same server allows MySQL to use the CPU and Apache to use the disk, perfectly
complimenting each other. Plus, on the same server Apache can more efficiently communicate
with MySQL. On separate servers, all SQL queries have to be marshalled across the network,
creating wasteful load on both machines. Performance wise, splitting them to separate servers
has a significant cost which is justified only if you HAVE to, or if you're going to carefully optimize
the hardware for each. (Example - one small, super fast SSD for the MySQL, and an array of
large slow drives to store all of the web content.)