##// END OF EJS Templates
docs: clarify section on horizontal scaling - multi threading is not supported at all
Mads Kiilerich -
r8362:933d2579 default
parent child Browse files
Show More
@@ -48,27 +48,22 b' database platform.'
48 48 Horizontal scaling
49 49 ------------------
50 50
51 Scaling horizontally means running several Kallithea instances and let them
52 share the load. That can give huge performance benefits when dealing with large
53 amounts of traffic (many users, CI servers, etc.). Kallithea can be scaled
54 horizontally on one (recommended) or multiple machines.
51 Scaling horizontally means running several Kallithea instances (also known as
52 worker processes) and let them share the load. That is essential to serve other
53 users while processing a long-running request from a user. Usually, the
54 bottleneck on a Kallithea server is not CPU but I/O speed - especially network
55 speed. It is thus a good idea to run multiple worker processes on one server.
55 56
56 It is generally possible to run WSGI applications multithreaded, so that
57 several HTTP requests are served from the same Python process at once. That can
58 in principle give better utilization of internal caches and less process
59 overhead.
57 .. note::
60 58
61 One danger of running multithreaded is that program execution becomes much more
62 complex; programs must be written to consider all combinations of events and
63 problems might depend on timing and be impossible to reproduce.
59 Kallithea and the embedded Mercurial backend are not thread-safe. Each
60 worker process must thus be single-threaded.
64 61
65 Kallithea can't promise to be thread-safe, just like the embedded Mercurial
66 backend doesn't make any strong promises when used as Kallithea uses it.
67 Instead, we recommend scaling by using multiple server processes.
62 Web servers can usually launch multiple worker processes - for example ``mod_wsgi`` with the
63 ``WSGIDaemonProcess`` ``processes`` parameter or ``uWSGI`` or ``gunicorn`` with
64 their ``workers`` setting.
68 65
69 Web servers with multiple worker processes (such as ``mod_wsgi`` with the
70 ``WSGIDaemonProcess`` ``processes`` parameter) will work out of the box.
71
66 Kallithea can also be scaled horizontally across multiple machines.
72 67 In order to scale horizontally on multiple machines, you need to do the
73 68 following:
74 69
@@ -125,3 +120,6 b' response. See the documentation for your'
125 120
126 121
127 122 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
123 .. _mod_wsgi: https://modwsgi.readthedocs.io/
124 .. _uWSGI: https://uwsgi-docs.readthedocs.io/
125 .. _gunicorn: http://pypi.python.org/pypi/gunicorn
General Comments 0
You need to be logged in to leave comments. Login now