[英]What is the default size of Socket “Max Per Group” in Chrome, Mozilla and IE?
[英]In Circus, the process and socket manager by mozilla, what is a singleton?
配置觀察者時,在觀看時包含這兩個設置的目的是什么:
singleton = True
numprocess = 1
文檔說明設置singleton
具有以下效果:
單:
如果設置為True,則此觀察者將擁有最多一個進程。 默認為False 。
我讀到這是否定了指定numprocesses
的需要,但是在github存儲庫中它們提供了一個例子:
https://github.com/circus-tent/circus/blob/master/examples/example6.ini
這里也包括,它們指定了兩者:
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
stats_endpoint = tcp://127.0.0.1:5557
httpd = True
debug = True
httpd_port = 8080
[watcher:swiss]
cmd = ../bin/python
args = -u flask_app.py
warmup_delay = 0
numprocesses = 1
singleton = True
stdout_stream.class = StdoutStream
stderr_stream.class = StdoutStream
所以我會假設他們做了不同的事情並以某種方式一起工作?
numprocess
是給定觀察者的初始進程數。 在您提供的示例中,它設置為1
,但用戶通常可以根據需要添加更多進程。
singleton
只允許給定觀察者運行最多1
進程,因此它將禁止您動態增加進程數。
馬戲團測試套件下面的代碼描述得很好::
@tornado.testing.gen_test
def test_singleton(self):
# yield self._stop_runners()
yield self.start_arbiter(singleton=True, loop=get_ioloop())
cli = AsyncCircusClient(endpoint=self.arbiter.endpoint)
# adding more than one process should fail
yield cli.send_message('incr', name='test')
res = yield cli.send_message('list', name='test')
self.assertEqual(len(res.get('pids')), 1)
yield self.stop_arbiter()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.