开发者

What are some ways to reduce the amount of resources being used in mysql from queries being ran?

My site is running fine but anytime I try to make changes to the database it moves extremely slow and sometimes freezes up. This being due to the load being too h开发者_Python百科igh from too many queries being ran, I've already reduced the number of queries yet my websites traffic keeps increasing and continuing to cause mysql to run slow. My admins have optimized mysql already so I'm looking for alternative methods to improve the performance of the database and decrease the load without running fewer queries.


Apart from upgrading the server hardware or installing new servers, I would look into a query profiler such as the built in MySQL one or Jet Profiler which also comes highly recommended. This will help you identify bottlenecks in your queries.

Also, if a bottleneck is encountered, you may need to refactor your code in order to run less queries or make better use of table indices.

However, if your budget permits, @Marc's answer is definitely recommended.


If the DB itself is tweaked as far as it can go, you've got two other options:

  1. Upgrade hardware (faster disks, faster cpu, more ram)
  2. Set up a cluster of db servers so the load gets split amongst multiple machines.


Is it possible to further optimize your queries or schema?

I've found mysql's slow query log useful to identify which queries to profile and improve http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜