Comments (11)
Got it, thanks.
from reactor-pool.
@ifindya There is already such functionality. Can you try this configuration?
reactor-pool/reactor-pool/src/main/java/reactor/pool/PoolBuilder.java
Lines 227 to 249 in 574c24b
from reactor-pool.
Thank you so much. I have had a look. background tasks are used to evict idle connections and do not keep the connection active, sometimes needing to contain minIdle idle connections in the connection pool at all times until the pool shutdown, in other words, idle connections are exempt from eviction. Did I get that right?
from reactor-pool.
@ifindya Yes correct.
For example in Reactor Netty the connection pool has these settings: max idle time, max life time, active/closed connection.
So when the background task is executed these settings are checked and some of the connections might be evicted (removed) from the pool.
If the connection pool supports warm up then after the eviction, if the pool needs to be filled again with fresh connections then this will be performed.
from reactor-pool.
@violetagg That's to say Reactor Pool doesn't have these settings and might not warm up after the eviction, right? If so, is there a plan about supporting this?
from reactor-pool.
@violetagg That's to say Reactor Pool doesn't have these settings and might not warm up after the eviction, right? If so, is there a plan about supporting this?
On the contrary - everything as infrastructure/configurations is there, the library that uses Reactor Pool needs to use/configure them.
For example, Reactor Netty configures Reactor Pool like this:
https://github.com/reactor/reactor-netty/blob/61d1315c358e73b5a0c3c3e8ace89917f1a9a2ad/reactor-netty-core/src/main/java/reactor/netty/resources/PooledConnectionProvider.java#L489-L491
So if background task is enabled the connections will be checked for idle time, life time and whether they are closed.
Reactor Netty does not have configuration for warm up, but if the library that uses Reactor Pool enables the configuration for warm up then the pool will be filled with fresh resources.
from reactor-pool.
All right, then the implementations should be allowed to extend the background task and determine its behavior. Is there such an ability now?
from reactor-pool.
All right, then the implementations should be allowed to extend the background task and determine its behavior. Is there such an ability now?
Reactor Pool invokes only the eviction predicate. There is nothing else interesting in the background task.
The library that uses Reactor pool needs to provide eviction predicate.
As I see that you linked an issue in R2DBC - this means R2DBC has to provide this eviction predicate.
from reactor-pool.
In r2dbc-pool, when checking whether a connection is valid, a call to the database is made which might take a while. Does reactor-pool ensure that during the eviction check, the pool object (in this case, r2dbc connection) which is being checked for eviction will not be used concurrently by the pool? Also, how to enable the configuration for warmup?
from reactor-pool.
In r2dbc-pool, when checking whether a connection is valid, a call to the database is made which might take a while. Does reactor-pool ensure that during the eviction check, the pool object (in this case, r2dbc connection) which is being checked for eviction will not be used concurrently by the pool?
yes
Also, how to enable the configuration for warmup?
reactor-pool/reactor-pool/src/main/java/reactor/pool/PoolBuilder.java
Lines 346 to 362 in 574c24b
from reactor-pool.
@ifindya Yes correct.
For example in Reactor Netty the connection pool has these settings: max idle time, max life time, active/closed connection. So when the background task is executed these settings are checked and some of the connections might be evicted (removed) from the pool.
If the connection pool supports warm up then after the eviction, if the pool needs to be filled again with fresh connections then this will be performed.
I am sorry we're not on the same page before. The library depends on Reactor pool uses eviction predicate to check whether connection is valid and that would require obtaining the connection from the pool, testing it, and removing it from the pool if invalid, thus connection validation might be a remote call(saying to send a message to server side) in non-block way and BiPredicate is incompatible. It seems that there is only one way that will be performed after the eviction is to provide DestoryHandler, which allows users to have effects on the pool from the outside. Therefore, it's not exactly a walk in the park to combine background eviction and warm up. Thanks for your reply in advance.
from reactor-pool.
Related Issues (20)
- maxPending limit is enforced with some de-facto leniency under heavy load HOT 4
- Possible pool resource release bug HOT 11
- Suppress CommonPoolTest#pendingLimitAsync(Function) onErrorDropped logging
- PoolMetrics.acquiredSize() is incremented too early HOT 1
- Missing SimpleDequePool.drain() when SimpleDequePool.cancelAcquire() HOT 1
- InstrumentedPool: better insights into pool inactivity HOT 1
- Constantly keeping 10 idle connections HOT 16
- Remove outdated issue template and Contributing.md
- Wrong pool metrics when invalidating an idle resource HOT 4
- Quiet period & timeout wait for waiting requests and active connections HOT 4
- Performance issue in SimpleDequePool class
- Soft eviction for in-use connections
- when I use spring cloud gataway,I find reactor.netty.internal.shaded.reactor.pool.AbstractPool.Borrower#request use a lot of cpu HOT 1
- Provide Micrometer PoolMetricsRecorder adapter HOT 3
- Problems when warmup procedure and database query procedure running in parallel.
- `PoolMetrics.allocatedSize` reports a different allocation count when the allocator uses threads HOT 4
- Incorrect handling of allocator errors during "warmup" in SimpleDequePool HOT 1
- InstrumentedPool.PoolMetrics isInactiveForMoreThan mixes time units HOT 3
- Warmup procedure fails if warmups were found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactor-pool.