Changeset - fb0417c65c64
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-11-16 20:23:31
mads@kiilerich.com
Grafted from: b6f9e7904eb3
docs: document official method for beaker cache cleanup
1 file changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/usage/performance.rst
Show inline comments
 
@@ -2,48 +2,57 @@
 

	
 
================================
 
Optimizing Kallithea performance
 
================================
 

	
 
When serving a large amount of big repositories, Kallithea can start performing
 
slower than expected. Because of the demanding nature of handling large amounts
 
of data from version control systems, here are some tips on how to get the best
 
performance.
 

	
 

	
 
Fast storage
 
------------
 

	
 
Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) and plenty of RAM
 
is usually more important than a fast CPU.
 

	
 

	
 
Caching
 
-------
 

	
 
Tweak beaker cache settings in the ini file. The actual effect of that is
 
questionable.
 

	
 
.. note::
 

	
 
    Beaker has no upper bound on cache size and will never drop any caches. For
 
    memory cache, the only option is to regularly restart the worker process.
 
    For file cache, it must be cleaned manually, as described in the `Beaker
 
    documentation <https://beaker.readthedocs.io/en/latest/sessions.html#removing-expired-old-sessions>`_::
 

	
 
        find data/cache -type f -mtime +30 -print -exec rm {} \;
 

	
 

	
 
Database
 
--------
 

	
 
SQLite is a good option when having a small load on the system. But due to
 
locking issues with SQLite, it is not recommended to use it for larger
 
deployments.
 

	
 
Switching to MySQL or PostgreSQL will result in an immediate performance
 
increase. A tool like SQLAlchemyGrate_ can be used for migrating to another
 
database platform.
 

	
 

	
 
Horizontal scaling
 
------------------
 

	
 
Scaling horizontally means running several Kallithea instances and let them
 
share the load. That can give huge performance benefits when dealing with large
 
amounts of traffic (many users, CI servers, etc.). Kallithea can be scaled
 
horizontally on one (recommended) or multiple machines.
 

	
 
It is generally possible to run WSGI applications multithreaded, so that
 
several HTTP requests are served from the same Python process at once. That can
 
in principle give better utilization of internal caches and less process
0 comments (0 inline, 0 general)