MySQL 查询和 PHP 脚本调优:如何找到问题?
我继承了一个网站,运行着几个不同的软件包,这些软件包是由几个不同的人在几年内开发的,其中有大量的修改和插件。
我怎样才能系统地、普遍地、并且希望自动记录/监视/查找使用慢速查询、持久连接、无索引连接等的脚本?
I have inherited a site running several different software packages worked on by several different people over several years, with lots of modifications and addons throughout.
How can I systematically, pervasively, and I hope automatically log/monitor/find scripts that use slow queries, persistent connections, unindexed joins, etc.?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有多种工具可以满足这些需求:
另外,在站点注释中,另一个很棒的工具是 Toad for MySQL(免费)提供完整的数据库管理(包括表、视图、触发器、函数、过程等)、图表和模式/数据比较功能。
我个人推荐,按顺序:
There is a variety of tools to service these needs:
Also on a site note, another awesome tool is Toad for MySQL (free) which provides full database management (including tables, views, triggers, functions, procedures, etc), diagramming, and schema/data comparison functions.
I personally recommend, in order:
您可以启用慢查询日志。
mysqltuner
也是调整最重要参数的良好起点。You can enable slow query log.
mysqltuner
is also good as a starting point to tune most important params.