Django manage.py creates multiple fcgi processes

Any idea what the difference between the two teams is below?

Command: manage.py runfcgi method = threaded host = 127.0.0.1 port = 3033

labs@li68:/var/www/django_projects/myproject$ ps aux|grep manage.py
labs   14558  0.0  2.2  65948  8212 ?        Sl   Oct19   0:09 python /var/www/django_projects/myproject/manage.py runfcgi method=threaded host=127.0.0.1 port=3033

Command: python manage.py runfcgi host = 127.0.0.1 port = 7021 protocol = fcgi pidfile = / tmp / myproject.fcgi.pid

labs@li68:/var/www/django_projects/myproject$ ps aux|grep manage.py
labs   21082  0.0  2.8  15440 10472 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid
labs   21083  0.0  2.7  15440 10084 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid
labs   21084  0.0  2.7  15440 10084 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid
labs   21085  0.0  2.7  15440 10084 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid
labs   21086  0.0  2.7  15440 10084 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid
labs   21087  0.0  2.7  15440 10084 ?        S    22:27   0:00 python manage.py runfcgi host=127.0.0.1 port=3034 protocol=fcgi pidfile=/tmp/myproject.fcgi.pid

The second command looks like it spawns 6 processes, with each allocated memory.

  • What would be the best option if you don't have much memory? and run multiple instances of django?
  • Why does the second command start 6 processes?
  • What are the advantages / disadvantages of each approach?
  • How do you limit the number of processes spawned?
+3
source share
1

, , , runfcgi method=prefork. FCGI ; , method=threaded FCGI.

. prefork , , . , forking , . , , , , , , ( , , , ).

6 ? , ?

Django , , . maxspare maxchildren.

+6

Source: https://habr.com/ru/post/1778394/


All Articles