#18135: Sleeping Database Connections on Startup with MySQL
-------------------------------------+-------------------------------------
     Reporter:  Mnewman              |                    Owner:  aaugustin
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Design
     Keywords:  MySQL                |  decision needed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

 Replying to [comment:26 Mnewman]:
 > So what happens on sites, like I have, that run millions of concurrents?
 I need hundreds of thousands threads to properly scale. I cannot afford a
 relational database that requires that many open "sleeping" connections.

 Exaggeration doesn't help your credibility. No one's running hundred of
 thousands of Django workers connected to a MySQL database without a
 pooler. And the topic of this ticket isn't persistent connections. At the
 moment, they're just a proposal, open for discussion on the mailing list.

 ----

 Back to the topic.

 I missed a use case in my previous comment: it's possible to have a MySQL
 database that's only occasionally hit by workers, especially if it isn't
 the primary database. Such a database could support fewer simultaneous
 connections than the total amount of workers.

 In the current codebase, the only place that uses the MySQL server version
 is `sequence_reset_by_name_sql`, and this function is only used by the
 tests. It appears that it was called at import time in previous versions
 of Django, but that isn't true any longer.

 One could argue for keeping this code in case future versions of Django
 introduce MySQL-version-dependent code that's evaluated at compile time,
 but in general, unnecessary code hurts maintainability.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18135#comment:27>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to