Too many instances are running for Django Server

2024/7/7 5:17:04

When Django server gets started, I can see only one instance of Django server running in the background. But after a while, I can see multiple instances are running.

Output:

root@GoldenGate:~# ps |grep python 1592 root     79636 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:802749 root     27936 S    python /root/celestial_NAS/manage.py runsslserver --certificate /etc/ssl/certs/server.crt --key /etc/ssl/private/ser2750 root     21056 S    python /root/celestial_NAS/manage.py runserver 0.0.0.0:803156 root     60160 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:803185 root     87764 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:803193 root     61188 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:808023 root     42732 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:808107 root     68360 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:808145 root     43760 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:809163 root     82712 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
12351 root     73484 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
13567 root      1304 S    /bin/sh -c python /root/celestial_NAS/changeadminpassword.py
13568 root     16684 R    python /root/celestial_NAS/changeadminpassword.py
13578 root      1304 S    grep python
16450 root     78608 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
19979 root     48884 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
24374 root     56060 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
25372 root     59132 S    /usr/bin/python /root/celestial_NAS/manage.py runserver 0.0.0.0:80
root@GoldenGate:~#

This effects performance of the system, Can you please help me to figure out what is the root cause behind start of multiple instances of single runserver(Django server) with multiple process ids.

Answer

Please follow these instructions: How to use Django with uWSGI

And here is another good one.

I believe theWanderer4865 has already explained the reason in details (patience, wow).

https://en.xdnf.cn/q/120015.html

Related Q&A

Not able to display images from static folder using Django

This is my home.html Im not able to display the images in static/images/ folder. Although *[09/Mar/2020 15:52:09] "GET /static/images/mona.jpg HTTP/1.1" 404 1669 * is displayed in terminal.&l…

Regex to match phone number 5ABCDYYZZ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.Closed 1 year ago.Improve …

Remove an \\n\\t\\t\\t-element from list

I got the following list called "phonenumbers". I struggle to remove the elements which contain \n\t\t\t and \n\t\t\t\t. I tried "try and except"-methode and remove(\n\t\t\t\t) but …

Find all numbers in a string in Python 3 [duplicate]

This question already has answers here:How to extract numbers from a string in Python?(20 answers)Split Strings into words with multiple word boundary delimiters(31 answers)Closed 8 years ago.Newbie h…

call dictionary from one function to another

How can I call a dictionary created in one function to another?I have tried using How do I access a dictionary from a function to be used in another function? but it doesnt work for me.I have created…

How to change values in numpy array

import numpy as np a=np.array([[4,2,6],[3,6,5]]) b=np.array([3,5])I want to update the numbers in "a" which are bigger than the numbers in "b" to np.nan. If they are smaller or equa…

Why use the object oriented approach in matplotlib for visualizing data? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to repro…

Set a status for a discord bot

I am trying to get my bot to have the status, m!help. I see that a lot of other bots have their help command in their status so I wanted to do that too. await bot.change_presence(activity=discord.Game(…

Can you permanently change python code by input?

Im still learning python and am currently developing an API (artificial personal assistant e.g. Siri or Cortana). I was wondering if there was a way to update code by input. For example, if I had a lis…

Count the number of files with a special suffix in a directory using python

It is possible to count the number of all files in a directory by:import ospath = /mnt/BIGDATA/num_files = len([f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))])As mentioned in How…