@@ -186,12 +186,12 @@ Shared.init_app("hello world!")
186
186
187
187
## Notes
188
188
189
- This module is rhetorical: because of the GIL Python is quite bad as a parallel
190
- language, so the point of creating threads which will mostly not really run in
191
- parallel is moot, thus the point of having a clever pool of stuff to be shared
192
- by these thread is even mooter! However, as the GIL is scheduled to go away
193
- in the coming years, starting from _ Python 3.13 _ , it might start to make sense
194
- to have such a thing here !
189
+ This module was initially rhetorical: because of the GIL Python was very bad as
190
+ a parallel language, so the point of creating threads which would mostly not
191
+ really run in parallel was moot, thus the point of having a clever pool of
192
+ stuff to be shared by these thread was even mooter!
193
+ However, as the GIL is scheduled to go away in the coming years, starting from
194
+ _ Python 3.13 _ (Fall 2024), it is startng to make sense to have such a thing!
195
195
196
196
In passing, it is interesting to note that the foremost
197
197
[ driving motivation] ( https://peps.python.org/pep-0703/ ) for getting
@@ -219,7 +219,18 @@ See Also:
219
219
- [ Eventlet db_pool] ( https://eventlet.net/doc/modules/db_pool.html )
220
220
for pooling MySQL or Postgres database connexions.
221
221
- [ Discussion] ( https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing )
222
- about database pool sizing (spoiler: small is beautiful).
222
+ about database pool sizing (spoiler: small is beautiful: you want threads
223
+ waiting for expensive resources used at full capacity rather than
224
+ many expensive resources under used).
225
+
226
+ Example of resources to put in a pool: connections to databases, authentication
227
+ services (eg LDAP), search engine…
228
+
229
+ For a typical REST backend, most requests will require one DB connection, thus
230
+ having an in-process pool with less connections is not very usefull, and more is
231
+ useless as well, so we may only have _ #conns == #threads_ which make sense.
232
+ The only point of having a pool is that the thread may be killed independently
233
+ and avoiding recreating connections in such cases.
223
234
224
235
## License
225
236
0 commit comments