升级后mysql查询变慢
我不知道我们的系统团队对mysql做了什么。但我的一个 jsp 页面需要大约 15 秒才能加载。升级只用了1秒。
相关表中只有大约200条条目。该页面与数据库的连接次数约为 60 次。奇怪的是,这么小的页面却出现这个问题。
其他查询mysql的JSP页面也有这个问题。
我想知道如何“调试”这个问题,以便我可以告诉我们的系统团队如何更改。非常感谢您的回复!
I don't know what our Systems team did to mysql. But one of my jsp pages takes about 15 seconds to load. It took only 1 second before upgrade.
There are only about 200 entries in related tables. And the page connects about 60 times to the database. It is weird that such small page has this issue.
Other JSP pages that query mysql have this issue too.
I want to know how to "DEBUG" this issue so I can tell our Systems team how to change. Your reply is highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先要尝试的事情之一是从 mysql 控制台运行相同的查询,并查看它们是否存在相同的性能问题。如果是这样,您可以使用“EXPLAIN”来查看查询分析器,看看它是否做了坏事。虽然只有 200 个条目,但这可能不是索引问题。
您的页面应该只物理连接到数据库一次。如果你做了 60 次,那就不好了。
这可能是连接池的问题,池大小设置得太小,因此它会阻塞等待连接变得可用。这个性能问题是否一致?
One of the first things to try is running the same queries from the mysql console, and seeing if they have the same performance problems. If so, you can use "EXPLAIN" to see the query analyzer and see if it is doing something bad. With only 200 entries though, it probably isn't an index issue.
Your page should only physically connect to the DB once. If you're doing it 60 times, that isn't good.
It could be an issue with connection pooling, that the pool size is set too small, so it is blocking waiting on a connection to become available. Is this performance problem consistent?
尝试使用
这里的链接来配合它
http://dev.mysql.com/doc/refman/5.1/ en/explain.html
try with
here is link to go with it
http://dev.mysql.com/doc/refman/5.1/en/explain.html