#20562: Docs: How to use django ORM with multiprocessing
--------------------------------------+------------------------------------
     Reporter:  guettli               |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  1.5
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by guettli):

 I created this ticket two years ago. I think a guideline is enough here.

 I resolved my issues by checking that no ORM code gets executed before the
 multiprocessing module spawns the workers.

 In other words:

  1. start the workers via multiprocessing.
  2. connect to DB.

 If you have N workers, you need N connections to the database.

 I think no change to the django code base is necessary. Just docs.

--
Ticket URL: <https://code.djangoproject.com/ticket/20562#comment:11>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2af1a47f5a15bf7361b898b99c89df1f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to