Scaling Best Practices

When deploying RhodeCode Enterprise at scale; 1000s of users, multiple instances, CI servers, there are a number of steps you can take to ensure you are getting the most out of your system.

Separate Users and CI Servers

You can configure multiple RhodeCode Enterprise instances to point to the same database and set of repositories. This lets users work on an instance that has less traffic than those being hit by CI servers. To configure this, use RhodeCode Control to install multiple instances and configure the database and repositories connection. If you do need to reset/adjust the database connection, see the Make Database Changes section.

You can configure then a load-balancer to balance the traffic between the CI dedicated instance and instance that end users would use. See the Nginx HTTP Server Configuration section for examples on how to do it in NGINX.

Switch to Database Sessions

To increase RhodeCode Enterprise performance switch from the default file based sessions to database-based. In such way all your distributed instances would not need to share the file storage to use file-based sessions. Database based session have an additional advantage of the file based ones that they don’t need a periodic cleanup as the session library cleans them up for users. For configuration details, see the Database Performance section.

Tuning RhodeCode Enterprise

There are also a number of options available to tune RhodeCode Enterprise for certain scenarios, including memory cache size. See the Tuning RhodeCode Enterprise section.

Use Authentication Tokens

Set up a user account for external services, and then use Authentication Tokens with those external services. These tokens work with push/pull operations only, and you can manage multiple tokens through this user account, and revoke particular ones if necessary. In this way one user can have multiple tokens, so all your jenkins/CI servers could share one account.

  • To enable tokens, go to Admin ‣ Authentication and enable the rhodecode.lib.auth_modules.auth_token library.
  • To create tokens, go to Username ‣ My Account ‣ Auth tokens and generate the necessary tokens. For more information, see the Authentication Tokens section.

Scaling Deployment Diagram

../_images/scaling-diagrm.png