如何在servlet中创建rinke()方法? [英] how to create shrink() method in servlet?

查看:67
本文介绍了如何在servlet中创建rinke()方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Java servlet中创建rink()连接方法?
不需要连接时缩小池大小的功能对于提高应用程序的性能很重要.

how to create shrink() connection method in java servlet?
feature to shrink the pool size when the connections are not needed are important to improve the performance of application

推荐答案

如果释放太多,则丢弃它.
过去,我已经实现了动态池化,很容易发现自己创建和丢弃的池超出了您的需要.在实践中,明智的是跟踪趋势,这是当前最常见的趋势-请求或返回.
如果您收到更多请求然后返回,请不要丢弃实例,因为可能会需要它们.
Keep a tab on how many objects are being used on average and when one is released discard it if you have too many.
I have implemented dynamic pooling in the past and it is easy to find yourself creating and discarding more than you need to. In practice it is sensible to keep track of the trend, that is what is more common currently - request or returns.
If you are receiving more requests then returns, don''t discard instances as they''ll probably be needed.


这篇关于如何在servlet中创建rinke()方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆