##// 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 .. _vcs-server:
1 .. _vcs-server:
2
2
3 VCS Server Management
3 VCS Server Management
4 ---------------------
4 ---------------------
5
5
6 The VCS Server handles |RCM| backend functionality. You need to configure
6 The VCS Server handles |RCM| backend functionality. You need to configure
7 a VCS Server to run with a |RCM| instance. If you do not, you will be missing
7 a VCS Server to run with a |RCM| instance. If you do not, you will be missing
8 the connection between |RCM| and its |repos|. This will cause error messages
8 the connection between |RCM| and its |repos|. This will cause error messages
9 on the web interface. You can run your setup in the following configurations,
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 * One VCS Server per |RCM| instance.
12 * One VCS Server per |RCM| instance.
13 * One VCS Server handling multiple instances.
13 * One VCS Server handling multiple instances.
14
14
15 .. important::
15 .. important::
16
16
17 If your server locale settings are not correctly configured,
17 If your server locale settings are not correctly configured,
18 |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post
18 |RCE| and the VCS Server can run into issues. See this `Ask Ubuntu`_ post
19 which explains the problem and gives a solution.
19 which explains the problem and gives a solution.
20
20
21 For more information, see the following sections:
21 For more information, see the following sections:
22
22
23 * :ref:`install-vcs`
23 * :ref:`install-vcs`
24 * :ref:`config-vcs`
24 * :ref:`config-vcs`
25 * :ref:`vcs-server-options`
25 * :ref:`vcs-server-options`
26 * :ref:`vcs-server-versions`
26 * :ref:`vcs-server-versions`
27 * :ref:`vcs-server-maintain`
27 * :ref:`vcs-server-maintain`
28 * :ref:`vcs-server-config-file`
28 * :ref:`vcs-server-config-file`
29 * :ref:`svn-http`
29 * :ref:`svn-http`
30
30
31 .. _install-vcs:
31 .. _install-vcs:
32
32
33 VCS Server Installation
33 VCS Server Installation
34 ^^^^^^^^^^^^^^^^^^^^^^^
34 ^^^^^^^^^^^^^^^^^^^^^^^
35
35
36 To install a VCS Server, see
36 To install a VCS Server, see
37 :ref:`Installing a VCS server <control:install-vcsserver>`.
37 :ref:`Installing a VCS server <control:install-vcsserver>`.
38
38
39 .. _config-vcs:
39 .. _config-vcs:
40
40
41 Hooking |RCE| to its VCS Server
41 Hooking |RCE| to its VCS Server
42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43
43
44 To configure a |RCE| instance to use a VCS server, see
44 To configure a |RCE| instance to use a VCS server, see
45 :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`.
45 :ref:`Configuring the VCS Server connection <control:manually-vcsserver-ini>`.
46
46
47 .. _vcs-server-options:
47 .. _vcs-server-options:
48
48
49 |RCE| VCS Server Options
49 |RCE| VCS Server Options
50 ^^^^^^^^^^^^^^^^^^^^^^^^
50 ^^^^^^^^^^^^^^^^^^^^^^^^
51
51
52 The following list shows the available options on the |RCM| side of the
52 The following list shows the available options on the |RCM| side of the
53 connection to the VCS Server. The settings are configured per
53 connection to the VCS Server. The settings are configured per
54 instance in the
54 instance in the
55 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
55 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
56
56
57 .. rst-class:: dl-horizontal
57 .. rst-class:: dl-horizontal
58
58
59 \vcs.backends <available-vcs-systems>
59 \vcs.backends <available-vcs-systems>
60 Set a comma-separated list of the |repo| options available from the
60 Set a comma-separated list of the |repo| options available from the
61 web interface. The default is ``hg, git, svn``,
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 \vcs.connection_timeout <seconds>
65 \vcs.connection_timeout <seconds>
65 Set the length of time in seconds that the VCS Server waits for
66 Set the length of time in seconds that the VCS Server waits for
66 requests to process. After the timeout expires,
67 requests to process. After the timeout expires,
67 the request is closed. The default is ``3600``. Set to a higher
68 the request is closed. The default is ``3600``. Set to a higher
68 number if you experience network latency, or timeout issues with very
69 number if you experience network latency, or timeout issues with very
69 large push/pull requests.
70 large push/pull requests.
70
71
71 \vcs.server.enable <boolean>
72 \vcs.server.enable <boolean>
72 Enable or disable the VCS Server. The available options are ``true`` or
73 Enable or disable the VCS Server. The available options are ``true`` or
73 ``false``. The default is ``true``.
74 ``false``. The default is ``true``.
74
75
75 \vcs.server <host:port>
76 \vcs.server <host:port>
76 Set the host, either hostname or IP Address, and port of the VCS server
77 Set the host, either hostname or IP Address, and port of the VCS server
77 you wish to run with your |RCM| instance.
78 you wish to run with your |RCM| instance.
78
79
79 .. code-block:: ini
80 .. code-block:: ini
80
81
81 ##################
82 ##################
82 ### VCS CONFIG ###
83 ### VCS CONFIG ###
83 ##################
84 ##################
84 # set this line to match your VCS Server
85 # set this line to match your VCS Server
85 vcs.server = 127.0.0.1:10004
86 vcs.server = 127.0.0.1:10004
86 # Set to False to disable the VCS Server
87 # Set to False to disable the VCS Server
87 vcs.server.enable = True
88 vcs.server.enable = True
88 vcs.backends = hg, git, svn
89 vcs.backends = hg, git, svn
89 vcs.connection_timeout = 3600
90 vcs.connection_timeout = 3600
90
91
91
92
92 .. _vcs-server-versions:
93 .. _vcs-server-versions:
93
94
94 VCS Server Versions
95 VCS Server Versions
95 ^^^^^^^^^^^^^^^^^^^
96 ^^^^^^^^^^^^^^^^^^^
96
97
97 An updated version of the VCS Server is released with each |RCE| version. Use
98 An updated version of the VCS Server is released with each |RCE| version. Use
98 the VCS Server number that matches with the |RCE| version to pair the
99 the VCS Server number that matches with the |RCE| version to pair the
99 appropriate ones together. For |RCE| versions pre 3.3.0,
100 appropriate ones together. For |RCE| versions pre 3.3.0,
100 VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:
101 VCS Server 1.X.Y works with |RCE| 3.X.Y, for example:
101
102
102 * VCS Server 1.0.0 works with |RCE| 3.0.0
103 * VCS Server 1.0.0 works with |RCE| 3.0.0
103 * VCS Server 1.2.2 works with |RCE| 3.2.2
104 * VCS Server 1.2.2 works with |RCE| 3.2.2
104
105
105 For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers
106 For |RCE| versions post 3.3.0, the VCS Server and |RCE| version numbers
106 match, for example:
107 match, for example:
107
108
108 * VCS Server |release| works with |RCE| |release|
109 * VCS Server |release| works with |RCE| |release|
109
110
110 .. _vcs-server-maintain:
111 .. _vcs-server-maintain:
111
112
112 VCS Server Memory Optimization
113 VCS Server Memory Optimization
113 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114
115
115 To configure the VCS server to manage the cache efficiently, you need to
116 To configure the VCS server to manage the cache efficiently, you need to
116 configure the following options in the
117 configure the following options in the
117 :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once
118 :file:`/home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini` file. Once
118 configured, restart the VCS Server.
119 configured, restart the VCS Server.
119
120
120 .. rst-class:: dl-horizontal
121 .. rst-class:: dl-horizontal
121
122
122 \beaker.cache.repo_object.type = memorylru
123 \beaker.cache.repo_object.type = memorylru
123 Configures the cache to discard the least recently used items.
124 Configures the cache to discard the least recently used items.
124 This setting takes the following valid options:
125 This setting takes the following valid options:
125
126
126 * ``memorylru``: The default setting, which removes the least recently
127 * ``memorylru``: The default setting, which removes the least recently
127 used items from the cache.
128 used items from the cache.
128 * ``memory``: Runs the VCS Server without clearing the cache.
129 * ``memory``: Runs the VCS Server without clearing the cache.
129 * ``nocache``: Runs the VCS Server without a cache. This will
130 * ``nocache``: Runs the VCS Server without a cache. This will
130 dramatically reduce the VCS Server performance.
131 dramatically reduce the VCS Server performance.
131
132
132 \beaker.cache.repo_object.max_items = 100
133 \beaker.cache.repo_object.max_items = 100
133 Sets the maximum number of items stored in the cache, before the cache
134 Sets the maximum number of items stored in the cache, before the cache
134 starts to be cleared.
135 starts to be cleared.
135
136
136 As a general rule of thumb, running this value at 120 resulted in a
137 As a general rule of thumb, running this value at 120 resulted in a
137 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
138 5GB cache. Running it at 240 resulted in a 9GB cache. Your results
138 will differ based on usage patterns and |repo| sizes.
139 will differ based on usage patterns and |repo| sizes.
139
140
140 Tweaking this value to run at a fairly constant memory load on your
141 Tweaking this value to run at a fairly constant memory load on your
141 server will help performance.
142 server will help performance.
142
143
143 To clear the cache completely, you can restart the VCS Server.
144 To clear the cache completely, you can restart the VCS Server.
144
145
145 .. important::
146 .. important::
146
147
147 While the VCS Server handles a restart gracefully on the web interface,
148 While the VCS Server handles a restart gracefully on the web interface,
148 it will drop connections during push/pull requests. So it is recommended
149 it will drop connections during push/pull requests. So it is recommended
149 you only perform this when there is very little traffic on the instance.
150 you only perform this when there is very little traffic on the instance.
150
151
151 Use the following example to restart your VCS Server,
152 Use the following example to restart your VCS Server,
152 for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.
153 for full details see the :ref:`RhodeCode Control CLI <control:rcc-cli>`.
153
154
154 .. code-block:: bash
155 .. code-block:: bash
155
156
156 $ rccontrol status
157 $ rccontrol status
157
158
158 .. code-block:: vim
159 .. code-block:: vim
159
160
160 - NAME: vcsserver-1
161 - NAME: vcsserver-1
161 - STATUS: RUNNING
162 - STATUS: RUNNING
162 - TYPE: VCSServer
163 logs:/home/ubuntu/.rccontrol/vcsserver-1/vcsserver.log
163 - VERSION: 1.0.0
164 - VERSION: 4.7.2 VCSServer
164 - URL: http://127.0.0.1:10001
165 - URL: http://127.0.0.1:10008
166 - CONFIG: /home/ubuntu/.rccontrol/vcsserver-1/vcsserver.ini
165
167
166 $ rccontrol restart vcsserver-1
168 $ rccontrol restart vcsserver-1
167 Instance "vcsserver-1" successfully stopped.
169 Instance "vcsserver-1" successfully stopped.
168 Instance "vcsserver-1" successfully started.
170 Instance "vcsserver-1" successfully started.
169
171
170 .. _vcs-server-config-file:
172 .. _vcs-server-config-file:
171
173
172 VCS Server Configuration
174 VCS Server Configuration
173 ^^^^^^^^^^^^^^^^^^^^^^^^
175 ^^^^^^^^^^^^^^^^^^^^^^^^
174
176
175 You can configure settings for multiple VCS Servers on your
177 You can configure settings for multiple VCS Servers on your
176 system using their individual configuration files. Use the following
178 system using their individual configuration files. Use the following
177 properties inside the configuration file to set up your system. The default
179 properties inside the configuration file to set up your system. The default
178 location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`.
180 location is :file:`home/{user}/.rccontrol/{vcsserver-id}/vcsserver.ini`.
179 For a more detailed explanation of the logger levers, see :ref:`debug-mode`.
181 For a more detailed explanation of the logger levers, see :ref:`debug-mode`.
180
182
181 .. rst-class:: dl-horizontal
183 .. rst-class:: dl-horizontal
182
184
183 \host <ip-address>
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 \port <int>
190 \port <int>
187 Set the port number on which the VCS Server will be available.
191 Set the port number on which the VCS Server will be available.
188
192
189 \locale <locale_utf>
193 \locale <locale_utf>
190 Set the locale the VCS Server expects.
194 Set the locale the VCS Server expects.
191
195
192 \threadpool_size <int>
196 \workers <int>
193 Set the size of the threadpool used to communicate
197 Set the number of process workers.Recommended
194 with the WSGI workers. This should be at least 6 times the number of
198 value is (2 * NUMBER_OF_CPUS + 1), eg 2CPU = 5 workers
195 WSGI worker processes.
196
199
197 \timeout <seconds>
200 \max_requests <int>
198 Set the timeout for RPC communication in seconds.
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 .. note::
213 .. note::
201
214
202 After making changes, you need to restart your VCS Server to pick them up.
215 After making changes, you need to restart your VCS Server to pick them up.
203
216
204 .. code-block:: ini
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 host = 127.0.0.1
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 locale = en_US.UTF-8
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 # cache regions, please don't change
262 # cache regions, please don't change
222 beaker.cache.regions = repo_object
263 beaker.cache.regions = repo_object
223 beaker.cache.repo_object.type = memorylru
264 beaker.cache.repo_object.type = memorylru
224 beaker.cache.repo_object.max_items = 1000
265 beaker.cache.repo_object.max_items = 100
225
226 # cache auto-expires after N seconds
266 # cache auto-expires after N seconds
227 beaker.cache.repo_object.expire = 10
267 beaker.cache.repo_object.expire = 300
228 beaker.cache.repo_object.enabled = true
268 beaker.cache.repo_object.enabled = true
229
269
230
270
231 ################################
271 ################################
232 ### LOGGING CONFIGURATION ####
272 ### LOGGING CONFIGURATION ####
233 ################################
273 ################################
234 [loggers]
274 [loggers]
235 keys = root, vcsserver, beaker
275 keys = root, vcsserver, beaker
236
276
237 [handlers]
277 [handlers]
238 keys = console
278 keys = console
239
279
240 [formatters]
280 [formatters]
241 keys = generic
281 keys = generic
242
282
243 #############
283 #############
244 ## LOGGERS ##
284 ## LOGGERS ##
245 #############
285 #############
246 [logger_root]
286 [logger_root]
247 level = NOTSET
287 level = NOTSET
248 handlers = console
288 handlers = console
249
289
250 [logger_vcsserver]
290 [logger_vcsserver]
251 level = DEBUG
291 level = DEBUG
252 handlers =
292 handlers =
253 qualname = vcsserver
293 qualname = vcsserver
254 propagate = 1
294 propagate = 1
255
295
256 [logger_beaker]
296 [logger_beaker]
257 level = DEBUG
297 level = DEBUG
258 handlers =
298 handlers =
259 qualname = beaker
299 qualname = beaker
260 propagate = 1
300 propagate = 1
261
301
262
302
263 ##############
303 ##############
264 ## HANDLERS ##
304 ## HANDLERS ##
265 ##############
305 ##############
266
306
267 [handler_console]
307 [handler_console]
268 class = StreamHandler
308 class = StreamHandler
269 args = (sys.stderr,)
309 args = (sys.stderr,)
270 level = DEBUG
310 level = DEBUG
271 formatter = generic
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 ## FORMATTERS ##
314 ## FORMATTERS ##
289 ################
315 ################
290
316
291 [formatter_generic]
317 [formatter_generic]
292 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
318 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
293 datefmt = %Y-%m-%d %H:%M:%S
319 datefmt = %Y-%m-%d %H:%M:%S
294
320
295
321
296 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
322 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
297
323
298 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
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