Project

General

Profile

Actions

Feature #28952

closed

Update User#last_login_on only once per minute

Added by Holger Just almost 6 years ago. Updated almost 6 years ago.

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

0%

Estimated time:
Resolution:
Fixed

Description

On setups where a lot of logins happen (e.g. when heavily using the API with Basic Auth credentials), access to the@ users@ table can get contentioned due to the many parallel write queries to the table during each request as each requests sets the last_login_on column of the user to the current date in User.try_to_login. This can result in deadlocks or general long lock waits on the database since all of these update queries will effectively be serialized per user.

By updating the last_login_on column less often, we can drastically reduce this contention. The attached patch implements this by only updating the last_login_on column once per minute.


Files


Related issues

Related to Redmine - Defect #20648: Users' "Last connection" is not updated correctly.Closed

Actions
Related to Redmine - Feature #29041: Update session token only once per minuteClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF