H2 数据存储非常慢? (不是真的!请参阅编辑)
我刚刚测试了 H2 数据存储(使用 Datanucleus 2.x),
性能非常慢。 Postgres 的 1/3 和 MySQL 的 1/10(大约)
我对“规格”非常满意,但我看不到它们的“实际用法”。 http://www.h2database.com/html/performance.html
有性能吗我可能会错过的调整?
编辑:
H2 并不慢。是迄今为止我测试过的最快的 RDBMS 之一!
我需要帮助解释为什么我需要使用 WEB MANAGER(H2 控制台)连接到数据库才能获得此数据库引擎的惊人速度...通过 H2 WEB 连接时,我不小心测试了我的应用程序控制台“等瞧”,问题解决了。
为什么?
I just tested the H2 datastore (with Datanucleus 2.x)
The performance is VERY slow. 1/3 of Postgres and 1/10 of MySQL (aprox.)
I was very pleased by the "specs" but i cannot see them in "real usage".
http://www.h2database.com/html/performance.html
Is there any performance tuning that i might be missing?
EDIT:
H2 is not SLOW. Is one of the fastest RDBMS i have tested to date!
I need help explaining WHY i need to CONNECT to the database using the WEB MANAGER (H2 console) to get the fantastic speed of this DB engine... I accidentally tested my app when CONNECTED through the H2 WEB console "et voilá", problem solved.
Why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,H2 在最后一个连接关闭时关闭数据库。如果您的应用程序在每次操作后关闭唯一的连接,则数据库会被打开和关闭很多次,这会相当慢。
有多种方法可以解决此问题:
By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow.
There are multiple ways to solve this problem:
听起来您遇到了主机查找问题; 5 秒是典型的 DNS 超时。
Sounds like you have a host lookup problem; 5 seconds is a typical DNS timeout.