Closed
Bug 692383
Opened 13 years ago
Closed 11 years ago
smarter host-based mysql connection pooling
Categories
(Cloud Services :: Server: Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: petef, Assigned: rfkelly)
References
Details
(Whiteboard: [qa+])
Attachments
(2 files)
4.51 KB,
text/plain
|
Details | |
3.34 KB,
patch
|
telliott
:
review+
|
Details | Diff | Splinter Review |
With our node setup, we have ten different sqluris for one single mysql instance (one for each weaveN database). It would be great if the connection pooling was smart enough to keep connections per database *host*, and just set the proper database each time. This way, we can run more gunicorn workers without exhausting connections on the MySQL side.
Comment 1•13 years ago
|
||
I am starting to experiment on this in SA, by setting up a shared pool that would be able to switch to a database via 'use' on the fly. notes to myself - share the same pool object "one host - N similar DBs" - hook the 'checkout' event to run 'use' if needeed - on first connect event, call the dialect init on all DBS.
Updated•13 years ago
|
Assignee: nobody → tarek
Comment 2•13 years ago
|
||
Here's a first draft of a per-server pool system. in case a query is made on a server, a connection to this server will be reused, and the Database changed, without reconnections. Let's hook it in Storage and let's try it on a stress test whenever you have a chance Pete
Attachment #571942 -
Flags: review?(petef)
Updated•13 years ago
|
Whiteboard: [qa+]
Comment 3•12 years ago
|
||
Bumping this one, since I think it is something we're going to want to continue with going forward. Pete - any thoughts on the proposal?
Comment 4•12 years ago
|
||
the code is there, if people have interest again one day (next fire)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Comment 5•11 years ago
|
||
Please re-consider this bug.
Assignee: tarek → rfkelly
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Comment 6•11 years ago
|
||
Also, please incorporate a version of SQL Alchemy that addresses the connection pool bug shown here: http://hg.sqlalchemy.org/sqlalchemy/rev/aff95843c12f#l2.17
Updated•11 years ago
|
QA Contact: jbonacci
Assignee | ||
Comment 7•11 years ago
|
||
Here's my attempt at the-simplest-thing-that-could-possibly-work, taking the ideas from Tarek's patch but trying to avoid changes to any of the surrounding code. Tarek, can you comment on why you did not end up using events in your original patch? It seems to work OK here but I may be missing something. I'm a little concerned about the overhead of executing "USE dbname" ahead of every query, since it means an additional round-trip to the db server. It's the simplest option, so we should measure the overhead and see, but I wonder if it would be better to use fully-qualified dbname.tablename references and avoid this constant db switching.
Attachment #723308 -
Flags: review?(telliott)
Attachment #723308 -
Flags: feedback?(bobm)
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(tarek)
Comment 8•11 years ago
|
||
Comment on attachment 723308 [details] [diff] [review] add option to share connection pools for the same db host A few things about this patch make me nervous - mostly what damage could be caused if the switch failed, and some scaling concerns over the extra query (even though it's very fast), but it's good to move forward to testing and staging load.
Attachment #723308 -
Flags: review?(telliott) → review+
Assignee | ||
Comment 9•11 years ago
|
||
Per Bug 850057, this is now in production. Closing, will re-open if it doesn't seem to be doing that it's supposed to do.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Attachment #571942 -
Flags: review?(petef)
Updated•11 years ago
|
Flags: needinfo?(tarek)
Assignee | ||
Updated•11 years ago
|
Attachment #723308 -
Flags: feedback?(bobm)
You need to log in
before you can comment on or make changes to this bug.
Description
•