##// END OF EJS Templates
docs: updated docs about configuration of vcsserver.
marcink -
r1707:4b0fc208 default
parent child Browse files
Show More
@@ -1,298 +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 currently the best performance is one VCS Server per |RCM| instance:
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 which is all |repo| types available.
62 which is all |repo| types available. The order of backends is also the
63 order backend will try to detect requests type.
63 64
64 65 \vcs.connection_timeout <seconds>
65 66 Set the length of time in seconds that the VCS Server waits for
66 67 requests to process. After the timeout expires,
67 68 the request is closed. The default is ``3600``. Set to a higher
68 69 number if you experience network latency, or timeout issues with very
69 70 large push/pull requests.
70 71
71 72 \vcs.server.enable <boolean>
72 73 Enable or disable the VCS Server. The available options are ``true`` or
73 74 ``false``. The default is ``true``.
74 75
75 76 \vcs.server <host:port>
76 77 Set the host, either hostname or IP Address, and port of the VCS server
77 78 you wish to run with your |RCM| instance.
78 79
79 80 .. code-block:: ini
80 81
81 82 ##################
82 83 ### VCS CONFIG ###
83 84 ##################
84 85 # set this line to match your VCS Server
85 86 vcs.server = 127.0.0.1:10004
86 87 # Set to False to disable the VCS Server
87 88 vcs.server.enable = True
88 89 vcs.backends = hg, git, svn
89 90 vcs.connection_timeout = 3600
90 91
91 92
92 93 .. _vcs-server-versions:
93 94
94 95 VCS Server Versions
95 96 ^^^^^^^^^^^^^^^^^^^
96 97
97 98 An updated version of the VCS Server is released with each |RCE| version. Use
98 99 the VCS Server number that matches with the |RCE| version to pair the
99 100 appropriate ones together. For |RCE| versions pre 3.3.0,
100 101 VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:
101 102
102 103 * VCS Server 1.0.0 works with |RCE| 3.0.0
103 104 * VCS Server 1.2.2 works with |RCE| 3.2.2
104 105
105 106 For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers
106 107 match, for example:
107 108
108 109 * VCS Server |release| works with |RCE| |release|
109 110
110 111 .. _vcs-server-maintain:
111 112
112 113 VCS Server Memory Optimization
113 114 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114 115
115 116 To configure the VCS server to manage the cache efficiently, you need to
116 117 configure the following options in the
117 118 :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once
118 119 configured, restart the VCS Server.
119 120
120 121 .. rst-class:: dl-horizontal
121 122
122 123 \beaker.cache.repo_object.type = memorylru
123 124 Configures the cache to discard the least recently used items.
124 125 This setting takes the following valid options:
125 126
126 127 * ``memorylru``: The default setting, which removes the least recently
127 128 used items from the cache.
128 129 * ``memory``: Runs the VCS Server without clearing the cache.
129 130 * ``nocache``: Runs the VCS Server without a cache. This will
130 131 dramatically reduce the VCS Server performance.
131 132
132 133 \beaker.cache.repo_object.max_items = 100
133 134 Sets the maximum number of items stored in the cache, before the cache
134 135 starts to be cleared.
135 136
136 137 As a general rule of thumb, running this value at 120 resulted in a
137 138 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
138 139 will differ based on usage patterns and |repo| sizes.
139 140
140 141 Tweaking this value to run at a fairly constant memory load on your
141 142 server will help performance.
142 143
143 144 To clear the cache completely, you can restart the VCS Server.
144 145
145 146 .. important::
146 147
147 148 While the VCS Server handles a restart gracefully on the web interface,
148 149 it will drop connections during push/pull requests. So it is recommended
149 150 you only perform this when there is very little traffic on the instance.
150 151
151 152 Use the following example to restart your VCS Server,
152 153 for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.
153 154
154 155 .. code-block:: bash
155 156
156 157 $ rccontrol status
157 158
158 159 .. code-block:: vim
159 160
160 161 - NAME: vcsserver-1
161 162 - STATUS: RUNNING
162 - TYPE: VCSServer
163 - VERSION: 1.0.0
164 - URL: http://127.0.0.1:10001
163 logs:/home/ubuntu/.rccontrol/vcsserver-1/vcsserver.log
164 - VERSION: 4.7.2 VCSServer
165 - URL: http://127.0.0.1:10008
166 - CONFIG: /home/ubuntu/.rccontrol/vcsserver-1/vcsserver.ini
165 167
166 168 $ rccontrol restart vcsserver-1
167 169 Instance "vcsserver-1" successfully stopped.
168 170 Instance "vcsserver-1" successfully started.
169 171
170 172 .. _vcs-server-config-file:
171 173
172 174 VCS Server Configuration
173 175 ^^^^^^^^^^^^^^^^^^^^^^^^
174 176
175 177 You can configure settings for multiple VCS Servers on your
176 178 system using their individual configuration files. Use the following
177 179 properties inside the configuration file to set up your system. The default
178 180 location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`.
179 181 For a more detailed explanation of the logger levers, see :ref:`debug-mode`.
180 182
181 183 .. rst-class:: dl-horizontal
182 184
183 185 \host <ip-address>
184 Set the host on which the VCS Server will run.
186 Set the host on which the VCS Server will run. VCSServer is not
187 protected by any authentication, so we *highly* recommend running it
188 under localhost ip that is `127.0.0.1`
185 189
186 190 \port <int>
187 191 Set the port number on which the VCS Server will be available.
188 192
189 193 \locale <locale_utf>
190 194 Set the locale the VCS Server expects.
191 195
192 \threadpool_size <int>
193 Set the size of the threadpool used to communicate
194 with the WSGI workers. This should be at least 6 times the number of
195 WSGI worker processes.
196 \workers <int>
197 Set the number of process workers.Recommended
198 value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
196 199
197 \timeout <seconds>
198 Set the timeout for RPC communication in seconds.
200 \max_requests <int>
201 The maximum number of requests a worker will process before restarting.
202 Any value greater than zero will limit the number of requests a work
203 will process before automatically restarting. This is a simple method
204 to help limit the damage of memory leaks.
205
206 \max_requests_jitter <int>
207 The maximum jitter to add to the max_requests setting.
208 The jitter causes the restart per worker to be randomized by
209 randint(0, max_requests_jitter). This is intended to stagger worker
210 restarts to avoid all workers restarting at the same time.
211
199 212
200 213 .. note::
201 214
202 215 After making changes, you need to restart your VCS Server to pick them up.
203 216
204 217 .. code-block:: ini
205 218
206 219 ################################################################################
207 # RhodeCode VCSServer - configuration #
220 # RhodeCode VCSServer with HTTP Backend - configuration #
208 221 # #
209 222 ################################################################################
210 223
211 [DEFAULT]
224
225 [server:main]
226 ## COMMON ##
212 227 host = 127.0.0.1
213 port = 9900
228 port = 10002
229
230 ##########################
231 ## GUNICORN WSGI SERVER ##
232 ##########################
233 ## run with gunicorn --log-config vcsserver.ini --paste vcsserver.ini
234 use = egg:gunicorn#main
235 ## Sets the number of process workers. Recommended
236 ## value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
237 workers = 3
238 ## process name
239 proc_name = rhodecode_vcsserver
240 ## type of worker class, one of sync, gevent
241 ## recommended for bigger setup is using of of other than sync one
242 worker_class = sync
243 ## The maximum number of simultaneous clients. Valid only for Gevent
244 #worker_connections = 10
245 ## max number of requests that worker will handle before being gracefully
246 ## restarted, could prevent memory leaks
247 max_requests = 1000
248 max_requests_jitter = 30
249 ## amount of time a worker can spend with handling a request before it
250 ## gets killed and restarted. Set to 6hrs
251 timeout = 21600
252
253 [app:main]
254 use = egg:rhodecode-vcsserver
255
256 pyramid.default_locale_name = en
257 pyramid.includes =
258
259 ## default locale used by VCS systems
214 260 locale = en_US.UTF-8
215 # number of worker threads, this should be set based on a formula threadpool=N*6
216 # where N is number of RhodeCode Enterprise workers, eg. running 2 instances
217 # 8 gunicorn workers each would be 2 * 8 * 6 = 96, threadpool_size = 96
218 threadpool_size = 16
219 timeout = 0
220 261
221 262 # cache regions, please don't change
222 263 beaker.cache.regions = repo_object
223 264 beaker.cache.repo_object.type = memorylru
224 beaker.cache.repo_object.max_items = 1000
225
265 beaker.cache.repo_object.max_items = 100
226 266 # cache auto-expires after N seconds
227 beaker.cache.repo_object.expire = 10
267 beaker.cache.repo_object.expire = 300
228 268 beaker.cache.repo_object.enabled = true
229 269
230 270
231 271 ################################
232 272 ### LOGGING CONFIGURATION ####
233 273 ################################
234 274 [loggers]
235 275 keys = root, vcsserver, beaker
236 276
237 277 [handlers]
238 278 keys = console
239 279
240 280 [formatters]
241 281 keys = generic
242 282
243 283 #############
244 284 ## LOGGERS ##
245 285 #############
246 286 [logger_root]
247 287 level = NOTSET
248 288 handlers = console
249 289
250 290 [logger_vcsserver]
251 291 level = DEBUG
252 292 handlers =
253 293 qualname = vcsserver
254 294 propagate = 1
255 295
256 296 [logger_beaker]
257 297 level = DEBUG
258 298 handlers =
259 299 qualname = beaker
260 300 propagate = 1
261 301
262 302
263 303 ##############
264 304 ## HANDLERS ##
265 305 ##############
266 306
267 307 [handler_console]
268 308 class = StreamHandler
269 309 args = (sys.stderr,)
270 310 level = DEBUG
271 311 formatter = generic
272 312
273 [handler_file]
274 class = FileHandler
275 args = ('vcsserver.log', 'a',)
276 level = DEBUG
277 formatter = generic
278
279 [handler_file_rotating]
280 class = logging.handlers.TimedRotatingFileHandler
281 # 'D', 5 - rotate every 5days
282 # you can set 'h', 'midnight'
283 args = ('vcsserver.log', 'D', 5, 10,)
284 level = DEBUG
285 formatter = generic
286
287 313 ################
288 314 ## FORMATTERS ##
289 315 ################
290 316
291 317 [formatter_generic]
292 318 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
293 319 datefmt = %Y-%m-%d %H:%M:%S
294 320
295 321
296 322 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
297 323
298 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