mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 18:40:24 +00:00
fix: adjust pool usage in tests and examples
This commit is contained in:
@@ -15,7 +15,7 @@ This Cargo project implements various benchmarks for SQLx using
|
||||
the pool, with or without the pool being fair. Concurrently to the benchmark iteration
|
||||
function calling and blocking on `Pool::acquire()`, a varying number of background tasks are
|
||||
also calling `acquire()` and holding the acquired connection for 500µs each before releasing
|
||||
it back to the pool. The pool is created with `.min_size(50).max_size(50)` so we shouldn't
|
||||
it back to the pool. The pool is created with `.min_connections(50).max_connections(50)` so we shouldn't
|
||||
be measuring anything but the actual overhead of `Pool`'s bookeeping.
|
||||
|
||||
### Running
|
||||
|
||||
@@ -27,11 +27,11 @@ fn do_bench_acquire(b: &mut Bencher, concurrent: u32, fair: bool) {
|
||||
// we don't want timeouts because we want to see how the pool degrades
|
||||
.connect_timeout(Duration::from_secs(3600))
|
||||
// force the pool to start full
|
||||
.min_size(50)
|
||||
.max_size(50)
|
||||
.min_connections(50)
|
||||
.max_connections(50)
|
||||
// we're not benchmarking `ping()`
|
||||
.test_on_acquire(false)
|
||||
.fair(fair)
|
||||
.test_before_acquire(false)
|
||||
.__fair(fair)
|
||||
.build(
|
||||
&dotenv::var("DATABASE_URL").expect("DATABASE_URL must be set to run benchmarks"),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user