Answer to the Exact Question
Page Buffer sizing strategy: Compute a single shared buffer pool size that fits the expected workload while leaving headroom for OS and other processes. A common rule of thumb is to allocate 30‑40% of available RAM to the buffer pool, then adjust based on observed cache hit ratios.
Lock manager impact: In SuperServer the lock manager operates over a global lock table, so contention is shared across all connections. This can reduce per‑connection throughput compared to Classic, where each process has its own isolated lock table. However, the global lock table can be tuned (e.g., lock timeout, queue size, thread count) to mitigate contention and improve overall throughput for high‑concurrency workloads.
Confirmed Facts vs Likely Explanations
- Confirmed: Classic allocates a fixed‑size page buffer per process, leading to fragmentation and limited scalability.
- Confirmed: SuperServer exposes buffer pool settings via
superserver.conf and a runtime API.
- Likely: Switching to a dynamic buffer pool reduces fragmentation and improves cache hit rates, but requires careful sizing.
- Likely: The global lock table in SuperServer can be tuned to balance contention and throughput.
Step‑by‑Step Strategy for Buffer Pool Sizing
- Measure baseline memory usage: Run the current Classic server under typical load and note the total RAM consumption, including Firebird processes and OS overhead.
ps -o rss -p $(pgrep -f "firebird.*classic") | awk '{sum+=$1} END {print sum/1024 " MB"}'
- Determine target buffer pool size: Allocate 30‑40% of the available physical RAM to the buffer pool, subtracting a safety margin for OS and other services.
# Example: 16 GB RAM, target pool = 0.35 * 16 GB ≈ 5.6 GB
- Configure the pool: Edit
superserver.conf to enable the buffer pool and set the size.
[buffer_pool]
enabled = true
size_mb = 5632 # 5.6 GB rounded to MB
- Disable legacy buffer (if present): Ensure the classic buffer is turned off to avoid duplication.
[classic_buffer]
enabled = false
- Restart SuperServer and verify: Use the runtime API or
superserver --dump-config to confirm the pool size.
superserver --dump-config | grep buffer_pool
- Load test and profile: Run a representative workload and monitor cache hit ratio and memory usage.
superserver --metrics | grep hit_ratio
- Tune if necessary: Adjust
size_mb up or down by 5‑10% based on the profiling results.
Lock Manager Configuration and Throughput Impact
- Classic server: Each process maintains its own lock table; contention is local to the process, often resulting in higher per‑connection throughput for workloads with few concurrent transactions.
- SuperServer: Uses a single global lock table. While this reduces memory duplication, it introduces shared contention. High‑concurrency workloads may see increased lock wait times.
- Tuning options:
lock_timeout_ms – lower values reduce wait times but may increase aborts.
lock_queue_size – larger queues can accommodate more pending locks but increase memory usage.
lock_manager_threads – increasing threads can help process lock requests in parallel.
- Recommendation: Start with default lock manager settings, then monitor lock wait statistics. If wait times exceed 5% of transaction duration, consider increasing
lock_manager_threads or reducing lock_timeout_ms while ensuring application tolerates aborts.
Missing Diagnostic Detail
To refine the buffer pool sizing recommendation, I need to know the target maximum memory allocation for the page buffer in the new SuperServer configuration. This value will help adjust the 30‑40% rule to fit your specific hardware constraints.
Diagram
| Component |
| Classic Process |
| SuperServer Pool |
| Page Cache |
| Lock Manager |