Files @ ffd45b185016
Branch filter:

Location: kallithea/docs/usage/performance.rst

ffd45b185016 2.8 KiB text/prs.fallenstein.rst Show Annotation Show as Raw Download as Raw
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.

This imports changes between changesets 21af6c4eab3d and 6177597791c2 in
RhodeCode's original repository, including only changes to Python files and HTML.

RhodeCode clearly licensed its changes to these files under GPLv3
in their /LICENSE file, which states the following:
The Python code and integrated HTML are licensed under the GPLv3 license.

(See:
https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE
or
http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE
for an online copy of that LICENSE file)

Conservancy reviewed these changes and confirmed that they can be licensed as
a whole to the Kallithea project under GPLv3-only.

While some of the contents committed herein are clearly licensed
GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the
statement above from RhodeCode indicates that they intend GPLv3-only as their
license, per GPLv3ยง14 and other relevant sections of GPLv3.
.. _performance:

================================
Optimizing RhodeCode Performance
================================

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

* RhodeCode will perform better on machines with faster disks (SSD/SAN). It's
  more important to have faster disk than faster CPU.

* Slowness on initial page can be easily fixed by grouping repositories, and/or
  increasing cache size (see below), that includes using lightweight dashboard
  option and vcs_full_cache setting in .ini file


Follow these few steps to improve performance of RhodeCode system.


1. Increase cache

    in the .ini file::

     beaker.cache.sql_cache_long.expire=3600 <-- set this to higher number

    This option affects the cache expiration time for main page. Having
    few hundreds of repositories on main page can sometimes make the system
    to behave slow when cache expires for all of them. Increasing `expire`
    option to day (86400) or a week (604800) will improve general response
    times for the main page. RhodeCode has an intelligent cache expiration
    system and it will expire cache for repositories that had been changed.

2. Switch from sqlite to postgres or mysql

    sqlite is a good option when having small load on the system. But due to
    locking issues with sqlite, it's not recommended to use it for larger
    setup. Switching to mysql or postgres will result in a immediate
    performance increase.

3. Scale RhodeCode horizontally

    Scaling horizontally can give huge performance increase when dealing with
    large traffic (large amount of users, CI servers etc). RhodeCode can be
    scaled horizontally on one (recommended) or multiple machines. In order
    to scale horizontally you need to do the following:

    - each instance needs it's own .ini file and unique `instance_id` set in them
    - each instance `data` storage needs to be configured to be stored on a
      shared disk storage, preferably together with repositories. This `data`
      dir contains template caches, sessions, whoosh index and it's used for
      tasks locking (so it's safe across multiple instances). Set the
      `cache_dir`, `index_dir`, `beaker.cache.data_dir`, `beaker.cache.lock_dir`
      variables in each .ini file to shared location across RhodeCode instances
    - if celery is used each instance should run separate celery instance, but
      the message broken should be common to all of them (ex one rabbitmq
      shared server)
    - load balance using round robin or ip hash, recommended is writing LB rules
      that will separate regular user traffic from automated processes like CI
      servers or build bots.