Show More
@@ -1,67 +1,67 b'' | |||
|
1 | 1 | .. _user-session-ref: |
|
2 | 2 | |
|
3 | 3 | User Session Performance |
|
4 | 4 | ------------------------ |
|
5 | 5 | |
|
6 | 6 | The default file-based sessions are only suitable for smaller setups, or |
|
7 | 7 | instances that doesn't have a lot of users or traffic. |
|
8 | 8 | They are set as default option because it's setup-free solution. |
|
9 | 9 | |
|
10 | 10 | The most common issue of file based sessions are file limit errors which occur |
|
11 | 11 | if there are lots of session files. |
|
12 | 12 | |
|
13 | 13 | Therefore, in a large scale deployment, to give better performance, |
|
14 | 14 | scalability, and maintainability we recommend switching from file-based |
|
15 | 15 | sessions to database-based user sessions or Redis based sessions. |
|
16 | 16 | |
|
17 | 17 | To switch to database-based user sessions uncomment the following section in |
|
18 | 18 | your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file. |
|
19 | 19 | |
|
20 | 20 | |
|
21 | 21 | .. code-block:: ini |
|
22 | 22 | |
|
23 | 23 | ## db based session, fast, and allows easy management over logged in users |
|
24 | 24 | beaker.session.type = ext:database |
|
25 | 25 | beaker.session.table_name = db_session |
|
26 | 26 | |
|
27 | 27 | # use just one of the following according to the type of database |
|
28 | 28 | beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
29 | 29 | # or |
|
30 | 30 | beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
31 | 31 | |
|
32 | 32 | beaker.session.sa.pool_recycle = 3600 |
|
33 | 33 | beaker.session.sa.echo = false |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | and make sure you comment out the file based sessions. |
|
37 | 37 | |
|
38 | 38 | .. code-block:: ini |
|
39 | 39 | |
|
40 | 40 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
41 | 41 | #beaker.session.type = file |
|
42 | 42 | #beaker.session.data_dir = %(here)s/data/sessions/data |
|
43 | 43 | |
|
44 | 44 | |
|
45 | 45 | The `table_name` will be automatically created on specified database if it isn't yet existing. |
|
46 | 46 | Database specified in the `beaker.session.sa.url` can be the same that RhodeCode |
|
47 | 47 | uses, or if required it can be a different one. We recommend to use the same database. |
|
48 | 48 | |
|
49 | 49 | |
|
50 | 50 | |
|
51 | To switch to reds-based user sessions uncomment the following section in | |
|
51 | To switch to redis-based user sessions uncomment the following section in | |
|
52 | 52 | your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file. |
|
53 | 53 | |
|
54 | 54 | .. code-block:: ini |
|
55 | 55 | |
|
56 | 56 | ## redis sessions |
|
57 | 57 | beaker.session.type = ext:redis |
|
58 | 58 | beaker.session.url = localhost:6379 |
|
59 | 59 | |
|
60 | 60 | |
|
61 | 61 | and make sure you comment out the file based sessions. |
|
62 | 62 | |
|
63 | 63 | .. code-block:: ini |
|
64 | 64 | |
|
65 | 65 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
66 | 66 | #beaker.session.type = file |
|
67 | 67 | #beaker.session.data_dir = %(here)s/data/sessions/data No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now