[PLUG] Separating out MySQL and Apache to different boxes?

Russ Gilman-Hunt (YAR) gilmanhunt at comcast.net
Sat Dec 23 04:36:26 UTC 2006


On Fri, 22 Dec 2006 15:53:08 -0800
Kris <krisa at subtend.net> wrote:
(snip)

> I'm not a web-app developer nor a dba, but why should web-developers
> need to be db experts?
(snip)

Well, to my shame, I brought down a website just this past week due to
a mistake with the query.

I took a query that looked like this "select * from blah where (this or
that or the-other)" and changed it to "select * from blah where (that
or the-other)". "this" and "that" were semi-redundant
("field<linux_epoch_of_now OR field == 1"). The table had about
1,500,000 rows. With removing this OR clause, I changed which index the
query used from one with a cardinality of about 35000 to one with a
cardinality of about 1,500,000. The search slowed down to about 200
seconds per search, which caused the entire website to crash; they get
about 280,000 unique visitors daily, and I just overloaded the system.
All the web servers using the database went off-line, all the
replication slaves went off-line, and I couldn't back up my change
because the database was off-line (no authentication ... etc.)

I know, now, _why_ what I did broke the system. But before then, it was
"just remove one semi-redundant subclause in the OR clause."  Web
developer; not so much a database expert, apparently, though I'm pretty
good in general with construction of SQL statements. 

My point is- web developing without being a db expert ... can cause
problems that would not otherwise crop up. 

-- 
Russ Gilman-Hunt
http://www.arghwebworks.com/
gilmanhunt at comcast.net



More information about the PLUG mailing list