question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running multiple instances by supervisor

See original GitHub issue

I’m running this script by the supervisor in the background. What will happen if I increase numprocs to something greater than 1? Will I have an enhance in my speed? For example the following config:

[program:mtproxy]
command=python3.7 /opt/mtprotoproxy/mtprotoproxy.py
numprocs=10
process_name=%(program_name)s_%(process_num)02d

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alexberscommented, May 29, 2019

the multi-threading is slow, the current approach is the fastest way to multiplex the proxy server on several cores since the multiplexing is done in the linux kernel.

It is better to use many small proxy-servers instead of big because the big one is very easy to block by traffic patterns. Also it if it advertised somewhere it will likely be blocked.

2reactions
alexberscommented, May 28, 2019

Every process uses a single cpu core. If you have two cores you will get double performance if you run the script twice. If your server has 10 cores, it is better to run the proxy 10 times.

It is valid if you have really lot of users (~5 000) and the proxy process is cpu-bounded. If you have a few users, there will be no difference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start multiple python processes using supervisor
Run multiple instances of a python program on a single server to make better utilization of server resources.
Read more >
Supervisord creating multiple instances - Server Fault
The conf file is creating four instances. Any ideas why this is happening? root@haproxy:/etc/init.d# ps aux | grep haproxy haproxy 18 0.0 1.1 ......
Read more >
Supervisord config for running multiple processes in a single ...
Supervisord config for running multiple processes in a single container. - supervisord.conf.
Read more >
node.js - Supervisor starts more processes with one command
If I set numprocess to 2 for the example below, the supervisor will try to start the same process twice. Right? [program:cat] command=/bin/cat ......
Read more >
What is the right way to run multiple processes from my start ...
Using a worker is the recommended way of starting more than one process. But if you are not able to use a worker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found