Every repository with this icon (
Every repository with this icon (
Home
Summary
Nanopool is a JDBC2 connection that stands out by being very light weight and very scalable;
- Light weight in that the .jar file (at the time of writing) is a mere 35 kB, and nanopool itself has no dependencies on other libaries.
- Scalable in that the internal implementation of the pool is completely lock-free, and therefore does not impose any limit to concurrent use of the pool.
- Nanopool is a JDBC2 Connection Pool and requires your JDBC driver to implement the optional parts of the JDBC2 spec., but most drivers do this so it’s usually not a problem.
If it sounds good so far, you might want to check out these pages for more details:
- Sample Use — the nanopool variant of “hello world.”
- Configuration — what all the buttons and knobs are for.
It’s a young implementation
Nanopool is a very new implementation and has not seen a whole lot of real-life battle testing. Dispite this, NanoPool has all the basic features that you would expect of a modern connection pool: it can be resized while in use, and it can be exposed as a JMX MBean. It has a generic hooks mechanism and special hooks for handling high-contention situations in the pool.
Performance
Initial measurements of the performance have yield what I would “lukewarm” results with regards to the promise of near liniear scalability. I believe the reason to be the way I’ve tested thus far; against a real RDBMS, namely MySQL, and a real JDBC driver – all running on a puny dual-core machine.
Despite this inferior test methodology, I’ve been able to do test-runs that showed 400% increase in throughput as compared to MiniConnectionPoolManager1. Proper testing on a many-core machine, against a JDBC-driver mock and vs. other popular connection pools, is still pending.
These tests, however, are outdated and should be redone with a more recent version of NanoPool.
Footnotes
1 MiniConnectionPoolManager is another light-weight JDBC2 connection pool that is designed to be as small as possible. It uses intrinsic locks to keep its internal state thread-safe.







