kotolex / surrealist

Python library to work with SurrealDB
MIT License
20 stars 0 forks source link

Create Connection Pool #10

Closed kotolex closed 7 months ago

kotolex commented 7 months ago

2 connection by default and maximum 50, use "task-stealing" and check for busy threads, if they all busy -append new threads until max

Need to think how to integrate that in current Connection scheme

kotolex commented 7 months ago

For now seems problem exists - some kind of queue or cache under the hood of SurrealDB. So, now, if you have 20 threads for 1 user, it get responses one after the other, but not in parallel. Trying to know more via Discord

kotolex commented 7 months ago

yep, we have an task queue, so one big hard task can impact others https://github.com/orgs/surrealdb/discussions/3594#discussioncomment-8645504

kotolex commented 7 months ago

for now pool of connections can only be useful for lot of threads using surrealdb. For 2-3 places in the app it is not worth using, one common connection can be more performant At my tests I do not see a lot of improvements using pool, just for some cases, when a lot of threads inserts or selects big data

kotolex commented 7 months ago

35