問題タブ [apache-commons-pool]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
503 参照

java - Is it a bad practise to pass jedis instance between methods?

I was referring to this SO question, and I did couple of additions in this benchmark test. The main problem is my apis are getting slow as load increases on server. I am using jedis pool configuration.

And while using, I get Jedis instance in try-with-resources and works on it. I use very less pipelining and there are various calls to Redis, so each time a method call, a new jedis instance gets created.

As per SO question shared, my implementation will lead to very slow results. So, can I pass around Jedis instance to methods and work with pipeline as per business logic. Something like this -

Is there any way to improve on api calls? Could you recommend some projects which uses jedis on server side, so I will have a better understanding on how to use jedis effectively.

Redis / Jedis Configuration

Jedis version:2.8.1 Redis version:2.8.4 Java version:1.8

0 投票する
1 に答える
613 参照

spring - blockWhenExhausted を無効にした場合、CommonsPool2TargetSource は何をしますか?

非推奨の CommonPoolTargetSource には、 setWhenExhaustedActionName()を使用して定義できる一連の動作がありました。それがラップするCommonsPool2TargetSource と CommonsPool2 BaseGenericObjectPoolは、「getBlockWhenExhausted」を次のように記述します。

プールが使い果たされたときに BorrowObject() メソッドが呼び出されたときにブロックするかどうかを返します

それくらいわかった!そうでなければ、これは何をしますか?

CommonsPool を「WHEN_EXHAUSTED_GROW」に設定したときのようにプールが拡張されますか、それとも単に例外をスローしますか? 何が起こるのですか?