##// END OF EJS Templates
docs: deprecate beaker.cache in docs
marcink -
r3058:b5d3f00d default
parent child Browse files
Show More
@@ -1,118 +1,112 b''
1 1 .. _debug-mode:
2 2
3 3 Enabling Debug Mode
4 4 -------------------
5 5
6 6 To enable debug mode on a |RCE| instance you need to set the debug property
7 7 in the :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file. To
8 8 do this, use the following steps
9 9
10 10 1. Open the file and set the ``debug`` line to ``true``
11 11 2. Restart you instance using the ``rccontrol restart`` command,
12 12 see the following example:
13 13
14 14 You can also set the log level, the follow are the valid options;
15 15 ``debug``, ``info``, ``warning``, or ``fatal``.
16 16
17 17 .. code-block:: ini
18 18
19 19 [DEFAULT]
20 20 debug = true
21 21 pdebug = false
22 22
23 23 .. code-block:: bash
24 24
25 25 # Restart your instance
26 26 $ rccontrol restart enterprise-1
27 27 Instance "enterprise-1" successfully stopped.
28 28 Instance "enterprise-1" successfully started.
29 29
30 30 Debug and Logging Configuration
31 31 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 32
33 33 Further debugging and logging settings can also be set in the
34 34 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
35 35
36 36 In the logging section, the various packages that run with |RCE| can have
37 37 different debug levels set. If you want to increase the logging level change
38 38 ``level = DEBUG`` line to one of the valid options.
39 39
40 40 You also need to change the log level for handlers. See the example
41 41 ``##handler`` section below. The ``handler`` level takes the same options as
42 42 the ``debug`` level.
43 43
44 44 .. code-block:: ini
45 45
46 46 ################################
47 47 ### LOGGING CONFIGURATION ####
48 48 ################################
49 49 [loggers]
50 keys = root, sqlalchemy, beaker, rhodecode, ssh_wrapper
50 keys = root, sqlalchemy, rhodecode, ssh_wrapper
51 51
52 52 [handlers]
53 53 keys = console, console_sql, file, file_rotating
54 54
55 55 [formatters]
56 56 keys = generic, color_formatter, color_formatter_sql
57 57
58 58 #############
59 59 ## LOGGERS ##
60 60 #############
61 61 [logger_root]
62 62 level = NOTSET
63 63 handlers = console
64 64
65 65 [logger_routes]
66 66 level = DEBUG
67 67 handlers =
68 68 qualname = routes.middleware
69 69 ## "level = DEBUG" logs the route matched and routing variables.
70 70 propagate = 1
71 71
72 [logger_beaker]
73 level = DEBUG
74 handlers =
75 qualname = beaker.container
76 propagate = 1
77
78 72 [logger_rhodecode]
79 73 level = DEBUG
80 74 handlers =
81 75 qualname = rhodecode
82 76 propagate = 1
83 77
84 78 [logger_sqlalchemy]
85 79 level = INFO
86 80 handlers = console_sql
87 81 qualname = sqlalchemy.engine
88 82 propagate = 0
89 83
90 84 ##############
91 85 ## HANDLERS ##
92 86 ##############
93 87
94 88 [handler_console]
95 89 class = StreamHandler
96 90 args = (sys.stderr,)
97 91 level = INFO
98 92 formatter = generic
99 93
100 94 [handler_console_sql]
101 95 class = StreamHandler
102 96 args = (sys.stderr,)
103 97 level = WARN
104 98 formatter = generic
105 99
106 100 [handler_file]
107 101 class = FileHandler
108 102 args = ('rhodecode.log', 'a',)
109 103 level = INFO
110 104 formatter = generic
111 105
112 106 [handler_file_rotating]
113 107 class = logging.handlers.TimedRotatingFileHandler
114 108 # 'D', 5 - rotate every 5days
115 109 # you can set 'h', 'midnight'
116 110 args = ('rhodecode.log', 'D', 5, 10,)
117 111 level = INFO
118 112 formatter = generic
@@ -1,324 +1,324 b''
1 1 .. _vcs-server:
2 2
3 3 VCS Server Management
4 4 ---------------------
5 5
6 6 The VCS Server handles |RCM| backend functionality. You need to configure
7 7 a VCS Server to run with a |RCM| instance. If you do not, you will be missing
8 8 the connection between |RCM| and its |repos|. This will cause error messages
9 9 on the web interface. You can run your setup in the following configurations,
10 10 currently the best performance is one of following:
11 11
12 12 * One VCS Server per |RCM| instance.
13 13 * One VCS Server handling multiple instances.
14 14
15 15 .. important::
16 16
17 17 If your server locale settings are not correctly configured,
18 18 |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post
19 19 which explains the problem and gives a solution.
20 20
21 21 For more information, see the following sections:
22 22
23 23 * :ref:`install-vcs`
24 24 * :ref:`config-vcs`
25 25 * :ref:`vcs-server-options`
26 26 * :ref:`vcs-server-versions`
27 27 * :ref:`vcs-server-maintain`
28 28 * :ref:`vcs-server-config-file`
29 29 * :ref:`svn-http`
30 30
31 31 .. _install-vcs:
32 32
33 33 VCS Server Installation
34 34 ^^^^^^^^^^^^^^^^^^^^^^^
35 35
36 36 To install a VCS Server, see
37 37 :ref:`Installing a VCS server <control:install-vcsserver>`.
38 38
39 39 .. _config-vcs:
40 40
41 41 Hooking |RCE| to its VCS Server
42 42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 43
44 44 To configure a |RCE| instance to use a VCS server, see
45 45 :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`.
46 46
47 47 .. _vcs-server-options:
48 48
49 49 |RCE| VCS Server Options
50 50 ^^^^^^^^^^^^^^^^^^^^^^^^
51 51
52 52 The following list shows the available options on the |RCM| side of the
53 53 connection to the VCS Server. The settings are configured per
54 54 instance in the
55 55 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
56 56
57 57 .. rst-class:: dl-horizontal
58 58
59 59 \vcs.backends <available-vcs-systems>
60 60 Set a comma-separated list of the |repo| options available from the
61 61 web interface. The default is ``hg, git, svn``,
62 62 which is all |repo| types available. The order of backends is also the
63 63 order backend will try to detect requests type.
64 64
65 65 \vcs.connection_timeout <seconds>
66 66 Set the length of time in seconds that the VCS Server waits for
67 67 requests to process. After the timeout expires,
68 68 the request is closed. The default is ``3600``. Set to a higher
69 69 number if you experience network latency, or timeout issues with very
70 70 large push/pull requests.
71 71
72 72 \vcs.server.enable <boolean>
73 73 Enable or disable the VCS Server. The available options are ``true`` or
74 74 ``false``. The default is ``true``.
75 75
76 76 \vcs.server <host:port>
77 77 Set the host, either hostname or IP Address, and port of the VCS server
78 78 you wish to run with your |RCM| instance.
79 79
80 80 .. code-block:: ini
81 81
82 82 ##################
83 83 ### VCS CONFIG ###
84 84 ##################
85 85 # set this line to match your VCS Server
86 86 vcs.server = 127.0.0.1:10004
87 87 # Set to False to disable the VCS Server
88 88 vcs.server.enable = True
89 89 vcs.backends = hg, git, svn
90 90 vcs.connection_timeout = 3600
91 91
92 92
93 93 .. _vcs-server-versions:
94 94
95 95 VCS Server Versions
96 96 ^^^^^^^^^^^^^^^^^^^
97 97
98 98 An updated version of the VCS Server is released with each |RCE| version. Use
99 99 the VCS Server number that matches with the |RCE| version to pair the
100 100 appropriate ones together. For |RCE| versions pre 3.3.0,
101 101 VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:
102 102
103 103 * VCS Server 1.0.0 works with |RCE| 3.0.0
104 104 * VCS Server 1.2.2 works with |RCE| 3.2.2
105 105
106 106 For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers
107 107 match, for example:
108 108
109 109 * VCS Server |release| works with |RCE| |release|
110 110
111 111 .. _vcs-server-maintain:
112 112
113 113 VCS Server Memory Optimization
114 114 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115 115
116 To configure the VCS server to manage the cache efficiently, you need to
116 To optimize the VCS server to manage the cache and memory usage efficiently, you need to
117 117 configure the following options in the
118 118 :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once
119 configured, restart the VCS Server.
119 configured, restart the VCS Server. By default we use an optimal settings, but in certain
120 conditions tunning expiration_time and max_size can affect memory usage and performance
120 121
121 .. rst-class:: dl-horizontal
122 .. code-block:: ini
122 123
123 \beaker.cache.repo_object.type = memorylru
124 Configures the cache to discard the least recently used items.
125 This setting takes the following valid options:
124 ## cache region for storing repo_objects cache
125 rc_cache.repo_object.backend = dogpile.cache.rc.memory_lru
126
127 ## cache auto-expires after N seconds, setting this to 0 disabled cache
128 rc_cache.repo_object.expiration_time = 300
126 129
127 * ``memorylru``: The default setting, which removes the least recently
128 used items from the cache.
129 * ``memory``: Runs the VCS Server without clearing the cache.
130 * ``nocache``: Runs the VCS Server without a cache. This will
131 dramatically reduce the VCS Server performance.
130 ## max size of LRU, old values will be discarded if the size of cache reaches max_size
131 ## Sets the maximum number of items stored in the cache, before the cache
132 ## starts to be cleared.
132 133
133 \beaker.cache.repo_object.max_items = 100
134 Sets the maximum number of items stored in the cache, before the cache
135 starts to be cleared.
134 ## As a general rule of thumb, running this value at 120 resulted in a
135 ## 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
136 ## will differ based on usage patterns and |repo| sizes.
136 137
137 As a general rule of thumb, running this value at 120 resulted in a
138 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
139 will differ based on usage patterns and |repo| sizes.
138 ## Tweaking this value to run at a fairly constant memory load on your
139 ## server will help performance.
140 140
141 Tweaking this value to run at a fairly constant memory load on your
142 server will help performance.
141 rc_cache.repo_object.max_size = 120
142
143 143
144 144 To clear the cache completely, you can restart the VCS Server.
145 145
146 146 .. important::
147 147
148 148 While the VCS Server handles a restart gracefully on the web interface,
149 149 it will drop connections during push/pull requests. So it is recommended
150 150 you only perform this when there is very little traffic on the instance.
151 151
152 152 Use the following example to restart your VCS Server,
153 153 for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.
154 154
155 155 .. code-block:: bash
156 156
157 157 $ rccontrol status
158 158
159 159 .. code-block:: vim
160 160
161 161 - NAME: vcsserver-1
162 162 - STATUS: RUNNING
163 163 logs:/home/ubuntu/.rccontrol/vcsserver-1/vcsserver.log
164 164 - VERSION: 4.7.2 VCSServer
165 165 - URL: http://127.0.0.1:10008
166 166 - CONFIG: /home/ubuntu/.rccontrol/vcsserver-1/vcsserver.ini
167 167
168 168 $ rccontrol restart vcsserver-1
169 169 Instance "vcsserver-1" successfully stopped.
170 170 Instance "vcsserver-1" successfully started.
171 171
172 172 .. _vcs-server-config-file:
173 173
174 174 VCS Server Configuration
175 175 ^^^^^^^^^^^^^^^^^^^^^^^^
176 176
177 177 You can configure settings for multiple VCS Servers on your
178 178 system using their individual configuration files. Use the following
179 179 properties inside the configuration file to set up your system. The default
180 180 location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`.
181 181 For a more detailed explanation of the logger levers, see :ref:`debug-mode`.
182 182
183 183 .. rst-class:: dl-horizontal
184 184
185 185 \host <ip-address>
186 186 Set the host on which the VCS Server will run. VCSServer is not
187 187 protected by any authentication, so we *highly* recommend running it
188 188 under localhost ip that is `127.0.0.1`
189 189
190 190 \port <int>
191 191 Set the port number on which the VCS Server will be available.
192 192
193 193 \locale <locale_utf>
194 194 Set the locale the VCS Server expects.
195 195
196 196 \workers <int>
197 197 Set the number of process workers.Recommended
198 198 value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
199 199
200 200 \max_requests <int>
201 201 The maximum number of requests a worker will process before restarting.
202 202 Any value greater than zero will limit the number of requests a work
203 203 will process before automatically restarting. This is a simple method
204 204 to help limit the damage of memory leaks.
205 205
206 206 \max_requests_jitter <int>
207 207 The maximum jitter to add to the max_requests setting.
208 208 The jitter causes the restart per worker to be randomized by
209 209 randint(0, max_requests_jitter). This is intended to stagger worker
210 210 restarts to avoid all workers restarting at the same time.
211 211
212 212
213 213 .. note::
214 214
215 215 After making changes, you need to restart your VCS Server to pick them up.
216 216
217 217 .. code-block:: ini
218 218
219 219 ################################################################################
220 220 # RhodeCode VCSServer with HTTP Backend - configuration #
221 221 # #
222 222 ################################################################################
223 223
224 224
225 225 [server:main]
226 226 ## COMMON ##
227 227 host = 127.0.0.1
228 228 port = 10002
229 229
230 230 ##########################
231 231 ## GUNICORN WSGI SERVER ##
232 232 ##########################
233 233 ## run with gunicorn --log-config vcsserver.ini --paste vcsserver.ini
234 234 use = egg:gunicorn#main
235 235 ## Sets the number of process workers. Recommended
236 236 ## value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
237 237 workers = 3
238 238 ## process name
239 239 proc_name = rhodecode_vcsserver
240 240 ## type of worker class, one of sync, gevent
241 241 ## recommended for bigger setup is using of of other than sync one
242 242 worker_class = sync
243 243 ## The maximum number of simultaneous clients. Valid only for Gevent
244 244 #worker_connections = 10
245 245 ## max number of requests that worker will handle before being gracefully
246 246 ## restarted, could prevent memory leaks
247 247 max_requests = 1000
248 248 max_requests_jitter = 30
249 249 ## amount of time a worker can spend with handling a request before it
250 250 ## gets killed and restarted. Set to 6hrs
251 251 timeout = 21600
252 252
253 253 [app:main]
254 254 use = egg:rhodecode-vcsserver
255 255
256 256 pyramid.default_locale_name = en
257 257 pyramid.includes =
258 258
259 259 ## default locale used by VCS systems
260 260 locale = en_US.UTF-8
261 261
262 262 # cache regions, please don't change
263 263 beaker.cache.regions = repo_object
264 264 beaker.cache.repo_object.type = memorylru
265 265 beaker.cache.repo_object.max_items = 100
266 266 # cache auto-expires after N seconds
267 267 beaker.cache.repo_object.expire = 300
268 268 beaker.cache.repo_object.enabled = true
269 269
270 270
271 271 ################################
272 272 ### LOGGING CONFIGURATION ####
273 273 ################################
274 274 [loggers]
275 275 keys = root, vcsserver, beaker
276 276
277 277 [handlers]
278 278 keys = console
279 279
280 280 [formatters]
281 281 keys = generic
282 282
283 283 #############
284 284 ## LOGGERS ##
285 285 #############
286 286 [logger_root]
287 287 level = NOTSET
288 288 handlers = console
289 289
290 290 [logger_vcsserver]
291 291 level = DEBUG
292 292 handlers =
293 293 qualname = vcsserver
294 294 propagate = 1
295 295
296 296 [logger_beaker]
297 297 level = DEBUG
298 298 handlers =
299 299 qualname = beaker
300 300 propagate = 1
301 301
302 302
303 303 ##############
304 304 ## HANDLERS ##
305 305 ##############
306 306
307 307 [handler_console]
308 308 class = StreamHandler
309 309 args = (sys.stderr,)
310 310 level = DEBUG
311 311 formatter = generic
312 312
313 313 ################
314 314 ## FORMATTERS ##
315 315 ################
316 316
317 317 [formatter_generic]
318 318 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
319 319 datefmt = %Y-%m-%d %H:%M:%S
320 320
321 321
322 322 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
323 323
324 324 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
General Comments 0
You need to be logged in to leave comments. Login now