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