Ref T182916: Database error: Unable to connect to s7.web.db.svc.eqiad.wmflabs
- Ensure all PDO statement objects are dereferenced after use so that early close is actually possible.
- Track connection count and log it.
- Add method for closing a connection.
- Add early close where possible
- Use s1 for meta_p.wiki query (documented to be present on available on all db hosts)
- Add explicit close at end of web request.
- Add early close for CentralAuth db, only used for one query.
-
Sort all-wiki queries by slice so that we can open/close per batch and never have a conn open to more than one.Not done for now, given that the IP-based solution has already reduced connections from 9 to 1. At a later time when there is more than 1 minimum connection required, this can be revisited.
- Figure out a way to make centralauth use s7, without hardcoding it. https://gerrit.wikimedia.org/r/408751