Skip to content

Commit c55b47b

Browse files
committed
added a note on connection pooling
1 parent be746b5 commit c55b47b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: README.md

+8
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ To test connection resiliency you can using testing tools like [Locust.io](https
178178
while :; do curl -s -X GET http://localhost:5000/customer/$((RANDOM % 1000)); sleep 1; done
179179
```
180180

181+
## PyODBC, Linux and Connection Pooling
182+
183+
To get the best performances, Connection Pooling should be used so that each time the code tries to open and close a connection, it can just take an existing connection from the pool, reset it, and use that one. Using a connection from the pool is way less expensive than creating a new connection, so by using connection pooling performance can be greatly improved.
184+
185+
Unfortunately as of today (March 2020) ODBC connection pooling in Linux does work as expected to due an issue in unixODBC library. To work around that, I had to implement a manual technique to pool connection, that you can find in the `ConnectionManager` class.
186+
187+
Once the issue will be fixed, or if you are using Windows, you can completely remove that part of the code, and just open and close the connection as you would do normally, as connection pooling will be used automatically behind the scenes.
188+
181189
## Learn more
182190

183191
If you're new to Python and want to learn more, there is a full free Python curse here:

0 commit comments

Comments
 (0)