简体   繁体   English

在 JBoss 中指定数据源的最小和最大池大小

[英]Specify minimum and maximum pool size for datasource in JBoss

I will deploy a web application that will run on JBoss 4.2.3 on a production environment.我将部署一个 web 应用程序,该应用程序将在生产环境的 JBoss 4.2.3 上运行。 I would appreciate if you can give me some information or references about how can I estimate the minimum ( <min-pool-size> ) and maximum ( <max-pool-size> ) pool size for the datasource.如果您能给我一些关于如何估计数据源的最小 ( <min-pool-size> ) 和最大 ( <max-pool-size> ) 池大小的信息或参考资料,我将不胜感激。

It really depends on the load: how many users do access your application in a concurrent manner.这实际上取决于负载:有多少用户以并发方式访问您的应用程序。 And since people really seldom do things really concurrently it will be tough to guess.而且由于人们真的很少同时做事情,所以很难猜测。

Your best strategy might be to set the value pretty high and use a management console to observe connections.您最好的策略可能是将值设置得相当高并使用管理控制台来观察连接。 As far as I can recall the management console would show peaks, so take this value and set your max to a bigger value.据我所知,管理控制台会显示峰值,所以取这个值并将你的最大值设置为更大的值。

I would set min-pool-size to an value little less then average concurrent connection count or just leave it on default if you app doesn't show performance problems.我会将 min-pool-size 设置为略小于平均并发连接数的值,或者如果您的应用程序没有显示性能问题,则将其保留为默认值。 Having ready to use connections speeds up the app but if you don't see performance problems why bother.准备好使用连接会加快应用程序的速度,但如果您没有看到性能问题,为什么还要麻烦。

And of course you should take your database into accounts: how many concurrent connections does it allow, do you pay anything by concurrent connections or not.当然,您应该考虑您的数据库:它允许多少并发连接,您是否通过并发连接支付任何费用。

Observe performance: does your database server runs on the same machine as JBoss?观察性能:您的数据库服务器是否与 JBoss 在同一台机器上运行? More possible connections mean more concurrent work for the database server means more CPU usage - this may also affect performance of the app server.更多可能的连接意味着数据库服务器的更多并发工作意味着更多的 CPU 使用率——这也可能影响应用服务器的性能。

So again the best bet is a management console and a load test.所以最好的选择是管理控制台和负载测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM