Show More
@@ -1,60 +1,66 b'' | |||
|
1 | 1 | .. _user-session-ref: |
|
2 | 2 | |
|
3 | 3 | Increase 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 |
sessions to database-based user sessions or |
|
|
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 accoring to the type of database |
|
28 | 28 | beaker.session.sa.url = postgresql://postgres:secret@localhost/rhodecode |
|
29 | 29 | beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode |
|
30 | 30 | |
|
31 | 31 | beaker.session.sa.pool_recycle = 3600 |
|
32 | 32 | beaker.session.sa.echo = false |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | and make sure you comment out the file based sessions. |
|
36 | 36 | |
|
37 | 37 | .. code-block:: ini |
|
38 | 38 | |
|
39 | 39 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
40 | 40 | #beaker.session.type = file |
|
41 | 41 | #beaker.session.data_dir = %(here)s/data/sessions/data |
|
42 | 42 | |
|
43 | 43 | |
|
44 | To switch to memcached-based user sessions uncomment the following section in | |
|
44 | The `table_name` will be automatically created on specified database if it isn't yet existing. | |
|
45 | Database specified in the `beaker.session.sa.url` can be the same that RhodeCode | |
|
46 | uses, or if required it can be a different one. We recommend to use the same database. | |
|
47 | ||
|
48 | ||
|
49 | ||
|
50 | To switch to reds-based user sessions uncomment the following section in | |
|
45 | 51 | your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file. |
|
46 | 52 | |
|
47 | 53 | .. code-block:: ini |
|
48 | 54 | |
|
49 |
## |
|
|
50 |
beaker.session.type = ext: |
|
|
51 |
beaker.session.url = localhost: |
|
|
55 | ## redis sessions | |
|
56 | beaker.session.type = ext:redis | |
|
57 | beaker.session.url = localhost:6379 | |
|
52 | 58 | |
|
53 | 59 | |
|
54 | 60 | and make sure you comment out the file based sessions. |
|
55 | 61 | |
|
56 | 62 | .. code-block:: ini |
|
57 | 63 | |
|
58 | 64 | ## types are file, ext:memcached, ext:database, and memory (default). |
|
59 | 65 | #beaker.session.type = file |
|
60 | 66 | #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