D
D
dimonkoz2017-09-01 00:46:41
Django
dimonkoz, 2017-09-01 00:46:41

Why so many gunicorn worker processes?

workers = 4 threads = 1Tell me why if you specify and start the server in the gunicorn configs , the command pstree -ap|grep gunicornissues

|-gunicorn: maste,22988                                    
  |   |-gunicorn: worke,20372                                    
  |   |-gunicorn: worke,20373                                    
  |   |-gunicorn: worke,20374                                    
  |   `-gunicorn: worke,20375                                    
  |                   |-grep,20386 gunicorn

But after a load of requests:
|-gunicorn: maste,22988                                    
  |   |-gunicorn: worke,20372                                    
  |   |   |-{gunicorn: worke},20390
  |   |   `-{gunicorn: worke},20391
  |   |-gunicorn: worke,20373                                    
  |   |   |-{gunicorn: worke},20394
  |   |   `-{gunicorn: worke},20395
  |   |-gunicorn: worke,20375                                    
  |   |   |-{gunicorn: worke},20388
  |   |   `-{gunicorn: worke},20389
  |   `-gunicorn: worke,20396                                    
  |                   |-grep,20401 gunicorn

Inside the django application, I log pid and ppid, it turns out that each worker creates 2 workers when loaded. What is the logic behind this? What parameters set the ability to spawn processes by the workers themselves, and not by the master process?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question