Project

General

Profile

Actions

Feature #29041

closed

Update session token only once per minute

Added by Pavel Rosický almost 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

this is simmilar to #28952

if Rails.application.config.redmine_verify_sessions is enabled, basically each read request triggers an update to tokens table. This is bad for performance because it blocks the database.
My patch transforms the update query into a select query that doesn't block on heavy load. We could actually update the token only once per hour which is the minimum available setting for Setting.session_lifetime and Setting.session_timeout, but redmine modifications could use smaller values, so I choose 1 minute interval. Smaller session_timeout then 1 minute won't work now, but I think such small timeout doesn't make much sense.


Files

user.rb.patch (644 Bytes) user.rb.patch Pavel Rosický, 2018-06-17 19:55
sessions_controller_test.rb.patch (865 Bytes) sessions_controller_test.rb.patch Pavel Rosický, 2018-06-17 19:55
user.rb.patch (665 Bytes) user.rb.patch Pavel Rosický, 2018-06-18 11:05
29041.patch (1.64 KB) 29041.patch Patch by Pavel Rosický Go MAEDA, 2022-01-20 08:28

Related issues

Related to Redmine - Feature #28952: Update User#last_login_on only once per minuteClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF