Show More
@@ -1,61 +1,64 b'' | |||||
1 | .. _scaling-tips: |
|
1 | .. _scaling-tips: | |
2 |
|
2 | |||
3 | ====================== |
|
3 | ====================== | |
4 | Scaling Best Practices |
|
4 | Scaling Best Practices | |
5 | ====================== |
|
5 | ====================== | |
6 |
|
6 | |||
7 | When deploying |RCE| at scale; 100s of users, multiple instances, CI servers, |
|
7 | When deploying |RCE| at scale; 1000s of users, multiple instances, CI servers, | |
8 | there are a number of steps you can take to ensure you are getting the |
|
8 | there are a number of steps you can take to ensure you are getting the | |
9 | most out of your system. |
|
9 | most out of your system. | |
10 |
|
10 | |||
11 | Separate Users and CI Servers |
|
11 | Separate Users and CI Servers | |
12 | ----------------------------- |
|
12 | ----------------------------- | |
13 |
|
13 | |||
14 | You can configure multiple |RCE| instances to point to the same database and |
|
14 | You can configure multiple |RCE| instances to point to the same database and | |
15 | set of |repos|. This lets users work on an instance that has less traffic |
|
15 | set of |repos|. This lets users work on an instance that has less traffic | |
16 | than those being hit by CI servers. To configure this, use |RCC| to install |
|
16 | than those being hit by CI servers. To configure this, use |RCC| to install | |
17 | multiple instances and configure the database and |repos| connection. If you |
|
17 | multiple instances and configure the database and |repos| connection. If you | |
18 | do need to reset the database connection, see the |
|
18 | do need to reset/adjust the database connection, see the | |
19 | :ref:`config-database` section. |
|
19 | :ref:`config-database` section. | |
20 |
|
20 | |||
21 | Once configured, set your CI servers to use a particular instance and for |
|
21 | You can configure then a load-balancer to balance the traffic between the CI | |
22 | user specific instances you can configure loads balancing. See the |
|
22 | dedicated instance and instance that end users would use. | |
23 | :ref:`nginx-ws-ref` section for examples. |
|
23 | See the :ref:`nginx-ws-ref` section for examples on how to do it in NGINX. | |
24 |
|
24 | |||
25 | Switch to Database Sessions |
|
25 | Switch to Database Sessions | |
26 | --------------------------- |
|
26 | --------------------------- | |
27 |
|
27 | |||
28 |
To increase |
|
28 | To increase |RCE| performance switch from the default file based sessions to | |
29 | large scale deployment, we recommend switching from file-based |
|
29 | database-based. In such way all your distributed instances would not need to | |
30 | sessions to database-based user sessions. For configuration details, see the |
|
30 | share the file storage to use file-based sessions. | |
31 | :ref:`db-session-ref` section. |
|
31 | Database based session have an additional advantage of the file | |
|
32 | based ones that they don't need a periodic cleanup as the session library | |||
|
33 | cleans them up for users. For configuration details, | |||
|
34 | see the :ref:`db-session-ref` section. | |||
32 |
|
35 | |||
33 | Tuning |RCE| |
|
36 | Tuning |RCE| | |
34 | ------------ |
|
37 | ------------ | |
35 |
|
38 | |||
36 | There are also a number of options available to tune |RCE| for certain |
|
39 | There are also a number of options available to tune |RCE| for certain | |
37 | scenarios, including memory cache size. See the :ref:`rhodecode-tuning-ref` |
|
40 | scenarios, including memory cache size. See the :ref:`rhodecode-tuning-ref` | |
38 | section. |
|
41 | section. | |
39 |
|
42 | |||
40 | Use Authentication Tokens |
|
43 | Use Authentication Tokens | |
41 | ------------------------- |
|
44 | ------------------------- | |
42 |
|
45 | |||
43 | Set up a user account for external services, and then use Authentication |
|
46 | Set up a user account for external services, and then use Authentication | |
44 | Tokens with those external services. These tokens work with |
|
47 | Tokens with those external services. These tokens work with | |
45 | push/pull operations only, and you can manage multiple tokens through this user |
|
48 | push/pull operations only, and you can manage multiple tokens through this user | |
46 | account, and revoke particular ones if necessary. In this way one user can have |
|
49 | account, and revoke particular ones if necessary. In this way one user can have | |
47 | multiple tokens, so all your jenkins/CI servers could share one account. |
|
50 | multiple tokens, so all your jenkins/CI servers could share one account. | |
48 |
|
51 | |||
49 | * To enable tokens, go to :menuselection:`Admin --> Authentication` and enable |
|
52 | * To enable tokens, go to :menuselection:`Admin --> Authentication` and enable | |
50 | the `rhodecode.lib.auth_modules.auth_token` library. |
|
53 | the `rhodecode.lib.auth_modules.auth_token` library. | |
51 |
|
54 | |||
52 | * To create tokens, go to |
|
55 | * To create tokens, go to | |
53 | :menuselection:`Username --> My Account --> Auth tokens` and generate the |
|
56 | :menuselection:`Username --> My Account --> Auth tokens` and generate the | |
54 | necessary tokens. For more information, see the :ref:`config-token-ref` |
|
57 | necessary tokens. For more information, see the :ref:`config-token-ref` | |
55 | section. |
|
58 | section. | |
56 |
|
59 | |||
57 | Scaling Deployment Diagram |
|
60 | Scaling Deployment Diagram | |
58 | -------------------------- |
|
61 | -------------------------- | |
59 |
|
62 | |||
60 | .. image:: ../images/scaling-diagrm.png |
|
63 | .. image:: ../images/scaling-diagrm.png | |
61 | :align: center |
|
64 | :align: center |
General Comments 0
You need to be logged in to leave comments.
Login now