mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
multiprocessing adds latency; default to off
This commit is contained in:
parent
94ad1f5732
commit
47bc8bb466
|
@ -129,7 +129,9 @@ def main():
|
||||||
ap.add_argument("-i", metavar="IP", type=str, default="0.0.0.0", help="ip to bind")
|
ap.add_argument("-i", metavar="IP", type=str, default="0.0.0.0", help="ip to bind")
|
||||||
ap.add_argument("-p", metavar="PORT", type=int, default=1234, help="port to bind")
|
ap.add_argument("-p", metavar="PORT", type=int, default=1234, help="port to bind")
|
||||||
ap.add_argument("-nc", metavar="NUM", type=int, default=16, help="max num clients")
|
ap.add_argument("-nc", metavar="NUM", type=int, default=16, help="max num clients")
|
||||||
ap.add_argument("-j", metavar="CORES", type=int, help="max num cpu cores")
|
ap.add_argument(
|
||||||
|
"-j", metavar="CORES", type=int, default=1, help="max num cpu cores"
|
||||||
|
)
|
||||||
ap.add_argument("-a", metavar="ACCT", type=str, action="append", help="add account")
|
ap.add_argument("-a", metavar="ACCT", type=str, action="append", help="add account")
|
||||||
ap.add_argument("-v", metavar="VOL", type=str, action="append", help="add volume")
|
ap.add_argument("-v", metavar="VOL", type=str, action="append", help="add volume")
|
||||||
ap.add_argument("-q", action="store_true", help="quiet")
|
ap.add_argument("-q", action="store_true", help="quiet")
|
||||||
|
|
|
@ -29,7 +29,7 @@ class BrokerMp(object):
|
||||||
self.mutex = threading.Lock()
|
self.mutex = threading.Lock()
|
||||||
|
|
||||||
cores = self.args.j
|
cores = self.args.j
|
||||||
if cores is None:
|
if not cores:
|
||||||
cores = mp.cpu_count()
|
cores = mp.cpu_count()
|
||||||
|
|
||||||
self.log("broker", "booting {} subprocesses".format(cores))
|
self.log("broker", "booting {} subprocesses".format(cores))
|
||||||
|
|
|
@ -129,8 +129,8 @@ class SvcHub(object):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def check_mp_enable(self):
|
def check_mp_enable(self):
|
||||||
if self.args.j == 0:
|
if self.args.j == 1:
|
||||||
self.log("root", "multiprocessing disabled by argument -j 0;")
|
self.log("root", "multiprocessing disabled by argument -j 1;")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if mp.cpu_count() <= 1:
|
if mp.cpu_count() <= 1:
|
||||||
|
|
Loading…
Reference in a new issue