Skip to content

Comment on Scaling website (mysql) tips?

Comments

I would start off by seeing if you can't optimise that db server that you're running, that would be the low hanging fruit.

A tuned mysql server versus an out-of-the-box configured one will make a world of a difference.

It would be nice if you provided some more information about what you consider to be 'peak hours', how many queries per second you are processing, how the division between static and dynamic content on your site is and whether you have done things like enabling and analysing the 'slow query log'.

Have you used 'explain' on all your queries to make sure that you are not accidentally hitting all or a large number of rows in some of your queries ?

Peak hours would be 100 queries a second minimum. Static content is served by 2 different servers (1 img, 1 html). I did not know of the slow query log parameters (but will enable it now).

When starting we were pulling too many rows, but we quickly realized that and lowered scripts that display too much content that is not needed, we are also using proper indexes.

Other nasties to look out for: follow on queries that could have been done at the time of the first one and joins.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.