【玩框架】:用MySql进行性能测试
我正在努力在目前的工作中融入游戏。我的经理问我play框架如何处理100万条记录和MySql(我知道这很愚蠢)...我已经回答说JPA可以解决任何问题,PLAY也可以...但他想要一些报告...
所以,我考虑使用 play UnitTest 创建一个测试方法...一个来自数据库的简单查询,其中某个表中有一百万条记录。
问题:有没有办法模拟mysql数据库中的一百万条记录?
PS:我知道这可能不是一个与PLAY相关的问题...
I'm trying to implement play in my current job. And my manager asked me how would play framework deal with 1 millions records and MySql (I know that it is silly)...I've answered back that any problem JPA can address, PLAY also can... But he want some report...
So, I thought on creating a test method with play UnitTest... a simple query from the database with one million records in some table.
Question: Is there some way to simulate one millon record in mysql database ?
PS: I know that maybe it could not be a PLAY related question...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将一百万条记录插入表中。最多需要几分钟。没有真实数据就无法模拟真实性能。
Insert a million records into a table. It will take a few minutes at most. You can't simulate real performance without real data.
像这样的事情会有所帮助:
您可能需要经常处理刷新连接(这是来自内存,可能不太正确),以避免 Hibernate/JPA 缓存这么多行的问题:
Something like this will help:
You may need to deal a bit with flushing the connection every so often (this is from memory, may not be quite right) in order to avoid problems with Hibernate/JPA caching so many rows: