##// END OF EJS Templates
sessions: update session tunning instructions.
marcink -
r2851:55dc8f3a default
parent child Browse files
Show More
@@ -1,60 +1,66 b''
1 .. _user-session-ref:
1 .. _user-session-ref:
2
2
3 Increase User Session Performance
3 Increase 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 memcached 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 accoring to the type of database
27 # use just one of the following accoring 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 beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
29 beaker.session.sa.url = mysql://root:secret@127.0.0.1/rhodecode
30
30
31 beaker.session.sa.pool_recycle = 3600
31 beaker.session.sa.pool_recycle = 3600
32 beaker.session.sa.echo = false
32 beaker.session.sa.echo = false
33
33
34
34
35 and make sure you comment out the file based sessions.
35 and make sure you comment out the file based sessions.
36
36
37 .. code-block:: ini
37 .. code-block:: ini
38
38
39 ## types are file, ext:memcached, ext:database, and memory (default).
39 ## types are file, ext:memcached, ext:database, and memory (default).
40 #beaker.session.type = file
40 #beaker.session.type = file
41 #beaker.session.data_dir = %(here)s/data/sessions/data
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 your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
51 your :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file.
46
52
47 .. code-block:: ini
53 .. code-block:: ini
48
54
49 ## memcached sessions
55 ## redis sessions
50 beaker.session.type = ext:memcached
56 beaker.session.type = ext:redis
51 beaker.session.url = localhost:11211
57 beaker.session.url = localhost:6379
52
58
53
59
54 and make sure you comment out the file based sessions.
60 and make sure you comment out the file based sessions.
55
61
56 .. code-block:: ini
62 .. code-block:: ini
57
63
58 ## types are file, ext:memcached, ext:database, and memory (default).
64 ## types are file, ext:memcached, ext:database, and memory (default).
59 #beaker.session.type = file
65 #beaker.session.type = file
60 #beaker.session.data_dir = %(here)s/data/sessions/data No newline at end of file
66 #beaker.session.data_dir = %(here)s/data/sessions/data
General Comments 0
You need to be logged in to leave comments. Login now