changeset 5769:6afa528ee30e

db: get rid of vcs_full_cache - it should always be used It might make tests less deterministic, but it makes sure that we test what we actually use.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 14 Mar 2016 16:17:46 +0100
parents 5cb780fd494d
children 82f818616265
files development.ini docs/usage/performance.rst kallithea/bin/template.ini.mako kallithea/config/deployment.ini_tmpl kallithea/model/db.py kallithea/tests/test.ini scripts/generate-ini.py
diffstat 7 files changed, 7 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Mon Mar 14 16:17:46 2016 +0100
+++ b/development.ini	Mon Mar 14 16:17:46 2016 +0100
@@ -199,9 +199,6 @@
 ## cut off limit for large diffs (size in bytes)
 cut_off_limit = 256000
 
-## use cache version of scm repo everywhere
-vcs_full_cache = true
-
 ## force https in Kallithea, fixes https redirects, assumes it's always https
 force_https = false
 
--- a/docs/usage/performance.rst	Mon Mar 14 16:17:46 2016 +0100
+++ b/docs/usage/performance.rst	Mon Mar 14 16:17:46 2016 +0100
@@ -9,21 +9,17 @@
 amounts of data from version control systems, here are some tips on how to get
 the best performance.
 
-* Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is
-  usually more important than a fast CPU.
-
-* Sluggish loading of the front page can easily be fixed by grouping repositories or by
-  increasing cache size (see below). This includes using the lightweight dashboard
-  option and ``vcs_full_cache`` setting in .ini file.
-
 Follow these few steps to improve performance of Kallithea system.
 
-1. Increase cache
+1.  Kallithea is often I/O bound, and hence a fast disk (SSD/SAN) is
+    usually more important than a fast CPU.
+
+2. Increase cache
 
     Tweak beaker cache settings in the ini file. The actual effect of that
     is questionable.
 
-2. Switch from SQLite to PostgreSQL or MySQL
+3. Switch from SQLite to PostgreSQL or MySQL
 
     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
@@ -31,7 +27,7 @@
     performance increase. A tool like SQLAlchemyGrate_ can be used for
     migrating to another database platform.
 
-3. Scale Kallithea horizontally
+4. Scale Kallithea horizontally
 
     Scaling horizontally can give huge performance benefits when dealing with
     large amounts of traffic (many users, CI servers, etc.). Kallithea can be
--- a/kallithea/bin/template.ini.mako	Mon Mar 14 16:17:46 2016 +0100
+++ b/kallithea/bin/template.ini.mako	Mon Mar 14 16:17:46 2016 +0100
@@ -196,9 +196,6 @@
 <%text>## cut off limit for large diffs (size in bytes)</%text>
 cut_off_limit = 256000
 
-<%text>## use cache version of scm repo everywhere</%text>
-vcs_full_cache = true
-
 <%text>## force https in Kallithea, fixes https redirects, assumes it's always https</%text>
 force_https = false
 
--- a/kallithea/config/deployment.ini_tmpl	Mon Mar 14 16:17:46 2016 +0100
+++ b/kallithea/config/deployment.ini_tmpl	Mon Mar 14 16:17:46 2016 +0100
@@ -192,9 +192,6 @@
 ## cut off limit for large diffs (size in bytes)
 cut_off_limit = 256000
 
-## use cache version of scm repo everywhere
-vcs_full_cache = true
-
 ## force https in Kallithea, fixes https redirects, assumes it's always https
 force_https = false
 
--- a/kallithea/model/db.py	Mon Mar 14 16:17:46 2016 +0100
+++ b/kallithea/model/db.py	Mon Mar 14 16:17:46 2016 +0100
@@ -1439,11 +1439,7 @@
 
     @property
     def scm_instance(self):
-        import kallithea
-        full_cache = str2bool(kallithea.CONFIG.get('vcs_full_cache'))
-        if full_cache:
-            return self.scm_instance_cached()
-        return self.__get_instance()
+        return self.scm_instance_cached()
 
     def scm_instance_cached(self, valid_cache_keys=None):
         @cache_region('long_term', 'scm_instance_cached')
--- a/kallithea/tests/test.ini	Mon Mar 14 16:17:46 2016 +0100
+++ b/kallithea/tests/test.ini	Mon Mar 14 16:17:46 2016 +0100
@@ -2,7 +2,6 @@
 ################################################################################
 # Kallithea - config for tests:                                                #
 # initial_repo_scan = true                                                     #
-# vcs_full_cache = false                                                       #
 # sqlalchemy and kallithea_test.sqlite                                         #
 # custom logging                                                               #
 #                                                                              #
@@ -198,10 +197,6 @@
 ## cut off limit for large diffs (size in bytes)
 cut_off_limit = 256000
 
-## use cache version of scm repo everywhere
-#vcs_full_cache = true
-vcs_full_cache = false
-
 ## force https in Kallithea, fixes https redirects, assumes it's always https
 force_https = false
 
--- a/scripts/generate-ini.py	Mon Mar 14 16:17:46 2016 +0100
+++ b/scripts/generate-ini.py	Mon Mar 14 16:17:46 2016 +0100
@@ -40,7 +40,6 @@
         '''
         Kallithea - config for tests:
         initial_repo_scan = true
-        vcs_full_cache = false
         sqlalchemy and kallithea_test.sqlite
         custom logging
 
@@ -53,7 +52,6 @@
             '[app:main]': {
                 'initial_repo_scan': 'true',
                 'app_instance_uuid': 'test',
-                'vcs_full_cache': 'false',
                 'show_revision_number': 'true',
                 'beaker.cache.sql_cache_short.expire': '1',
                 'beaker.session.secret': '{74e0cd75-b339-478b-b129-07dd221def1f}',