Show More
@@ -48,27 +48,22 b' database platform.' | |||||
48 | Horizontal scaling |
|
48 | Horizontal scaling | |
49 | ------------------ |
|
49 | ------------------ | |
50 |
|
50 | |||
51 |
Scaling horizontally means running several Kallithea instances |
|
51 | Scaling horizontally means running several Kallithea instances (also known as | |
52 | share the load. That can give huge performance benefits when dealing with large |
|
52 | worker processes) and let them share the load. That is essential to serve other | |
53 | amounts of traffic (many users, CI servers, etc.). Kallithea can be scaled |
|
53 | users while processing a long-running request from a user. Usually, the | |
54 | horizontally on one (recommended) or multiple machines. |
|
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 | .. note:: | |
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. |
|
|||
60 |
|
58 | |||
61 | One danger of running multithreaded is that program execution becomes much more |
|
59 | Kallithea and the embedded Mercurial backend are not thread-safe. Each | |
62 | complex; programs must be written to consider all combinations of events and |
|
60 | worker process must thus be single-threaded. | |
63 | problems might depend on timing and be impossible to reproduce. |
|
|||
64 |
|
61 | |||
65 | Kallithea can't promise to be thread-safe, just like the embedded Mercurial |
|
62 | Web servers can usually launch multiple worker processes - for example ``mod_wsgi`` with the | |
66 | backend doesn't make any strong promises when used as Kallithea uses it. |
|
63 | ``WSGIDaemonProcess`` ``processes`` parameter or ``uWSGI`` or ``gunicorn`` with | |
67 | Instead, we recommend scaling by using multiple server processes. |
|
64 | their ``workers`` setting. | |
68 |
|
65 | |||
69 | Web servers with multiple worker processes (such as ``mod_wsgi`` with the |
|
66 | Kallithea can also be scaled horizontally across multiple machines. | |
70 | ``WSGIDaemonProcess`` ``processes`` parameter) will work out of the box. |
|
|||
71 |
|
||||
72 | In order to scale horizontally on multiple machines, you need to do the |
|
67 | In order to scale horizontally on multiple machines, you need to do the | |
73 | following: |
|
68 | following: | |
74 |
|
69 | |||
@@ -125,3 +120,6 b' response. See the documentation for your' | |||||
125 |
|
120 | |||
126 |
|
121 | |||
127 | .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate |
|
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