Python tornado with multi-process -
i found how execute tornado multi-process.
server = httpserver(app) server.bind(8888) server.start(0) #forks multiple sub-processes ioloop.current().start()
in situation there way share resource on processes?
and seems using same port on processes.
does tornado balance load each process?
if so, how do?
in general, when using multi-process mode processes communicate via external services: databases, cache servers, message queues, etc. there additional options available processes running on same machine (see multiprocessing
module`), in general once no longer using single process it's better techniques continue scale when move beyond single machine.
in scenario, kernel , not tornado load balancing across processes. in theory, self-correcting mechanism because new connection given process idle @ time connection arrives. however, in practice tends result in significant imbalances (the loaded process has 2-3x many connections least loaded), dedicated load balancing proxy result in more distribution.
Comments
Post a Comment