I am trying to upload my project to the server. There is already a project in the server now. I have new project which I want to run and replace the old project with the new one, so I pull the new project to the server. Then I activate the virtual environment and do all the necessary work. Then when I try to run the command:
uwsgi --plugins=python --chdir=/var/www/prjt/src/ --socket=127.0.0.1:8889 --module=prjt.wsgi:application &
it tell me that
probably another instance of uWSGI is running on the same address (127.0.0.1:8889).
bind(): Address already in use [core/socket.c line 761]
I searched for similar problems and found some solutions about killing all instance of uwsgi as mentioned in this answer here but could not find how to do it.
If you change uwsgi systemd service file, reload the daemon and restart the process by typing: sudo systemctl daemon-reload. sudo systemctl restart uwsgi.
ini configuration file. The threads option is used to tell uWSGI to start our application in prethreaded mode. That essentially means it is launching the application across multiple threads, making our four processes essentially eight processes.
Remember: lazy-apps is different from lazy, the first one only instructs uWSGI to load the application one time per worker, while the second is more invasive (and generally discouraged) as it changes a lot of internal defaults.
for me the way to kill uwsgi instances in a bruteforce manner was:
sudo pkill -f uwsgi -9
Add a pidfile to your command:
uwsgi --plugins=python --chdir=/var/www/prjt/src/ --socket=127.0.0.1:8889 --module=prjt.wsgi:application --pidfile /tmp/myapp.pid
Then use
uwsgi --stop /tmp/myapp.pid
to stop the uwsgi instance in a safe way.
If you didn't specify a pidfile when you started the first instance, you can kill it brutally using
kill `pidof uwsgi`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With