Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0025466
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2014-01-13 11:472014-02-12 18:29
ReporterjecharriView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed in Version3.0PR14Q2
StatusclosedFix in branchFixed in SCM revisionb424cda58024
ProjectionnoneETAnoneTarget Version3.0PR14Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned Toshankarb
Web browserGoogle Chrome
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0025466: Performace problem during the login

DescriptionPerformace problem during the login

Due to solve issue https://issues.openbravo.com/view.php?id=24962 [^] now we are having this issue. The problem is that now the query:
StringBuilder hql = new StringBuilder();
    hql.append("select count(*)");
    hql.append(" from ADSession s ");
    hql.append(" where s.loginStatus='F'");
    hql.append(" and s.username = :name");
    hql.append(" and s.creationDate > (select coalesce(max(s1.creationDate), s.creationDate-1)");
    hql.append(" from ADSession s1");
    hql.append(" where s1.username = s.username");
    hql.append(" and s1.loginStatus!='F')");
    Query q = OBDal.getInstance().getSession().createQuery(hql.toString());
    q.setParameter("name", userName);

is executed in file "src/org/openbravo/base/secureApp/UserLock.java" and that query has bad performance
Steps To Reproduce-confiure parameter "login.trial.user.lock"

Verify that it takes a long time to login for example if your table ad_session is big (200MB)
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0038651 closedalostale problems in user locking implementation 
related to defect 0044414 newTriage Platform Base UserLock feature (delay login on wrong login) has bad performance by default 

-  Notes
(0063718)
alostale (manager)
2014-01-27 15:30

Tested in a PG DB with 590K entries in AD_Session.

Time is reduced from ~75s to 320ms.
(0063719)
hgbot (developer)
2014-01-27 15:32

Repository: erp/devel/pi
Changeset: 496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jan 27 15:32:04 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^]

fixed bug 25466: login performance when checking user lock

  username is not joined but passed as parameter, in this way query is
  executed in a more efficient manner

---
M src/org/openbravo/base/secureApp/UserLock.java
---
(0063731)
shankarb (reporter)
2014-01-28 06:45

Code reviewed and verified in pi changeset 9b47b9cdf8c1.
(0063745)
jecharri (developer)
2014-01-28 11:57

The solution does not work in oracle. The query is still slow
(0063776)
hgbot (developer)
2014-01-29 11:06

Repository: erp/devel/pi
Changeset: b424cda58024897df64fdf1ba1512444bb741038
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jan 29 11:05:39 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b424cda58024897df64fdf1ba1512444bb741038 [^]

fixed bug 25466: login performance when checking user lock

  splitting query with subquery into 2 different ones which perform better

---
M src/org/openbravo/base/secureApp/UserLock.java
---
(0063778)
alostale (manager)
2014-01-29 11:09

After latest fix tested in:
-PG with 590K entries in AD_Session.
-ORA with 265K entries in AD_Session.

Improvements:
-PG remains almost the same as with previous fix: from 75s to 300ms
-ORA: from 85s to 100ms
(0063905)
jecharri (developer)
2014-02-04 22:39

For me the results are not as good as Asier had:

-before the patch 3 seconds
-after that 860ms x 2 = 1.720 seconds
(0064070)
shankarb (reporter)
2014-02-12 04:23

Code reviewed and verified in pi changeset d704451d1d2e.
(0064119)
hudsonbot (developer)
2014-02-12 18:29

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/d1a5bb862230 [^]
Maturity status: Test
(0064133)
hudsonbot (developer)
2014-02-12 18:29

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/d1a5bb862230 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2014-01-13 11:47 jecharri New Issue
2014-01-13 11:47 jecharri Assigned To => AugustoMauch
2014-01-13 11:47 jecharri Web browser => Google Chrome
2014-01-13 11:47 jecharri Modules => Core
2014-01-13 11:47 jecharri Resolution time => 1392764400
2014-01-13 11:47 jecharri Triggers an Emergency Pack => No
2014-01-14 13:34 alostale Tag Attached: Performance
2014-01-15 09:01 shuehner Issue Monitored: shuehner
2014-01-27 15:30 alostale Note Added: 0063718
2014-01-27 15:30 alostale Assigned To AugustoMauch => alostale
2014-01-27 15:32 hgbot Checkin
2014-01-27 15:32 hgbot Note Added: 0063719
2014-01-27 15:32 hgbot Status new => resolved
2014-01-27 15:32 hgbot Resolution open => fixed
2014-01-27 15:32 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^]
2014-01-27 15:33 alostale Review Assigned To => shankarb
2014-01-28 06:45 shankarb Note Added: 0063731
2014-01-28 06:45 shankarb Status resolved => closed
2014-01-28 06:45 shankarb Fixed in Version => 3.0MP32
2014-01-28 11:57 jecharri Note Added: 0063745
2014-01-28 11:57 jecharri Status closed => new
2014-01-28 11:57 jecharri Resolution fixed => open
2014-01-28 11:57 jecharri Fixed in Version 3.0MP32 =>
2014-01-29 11:06 hgbot Checkin
2014-01-29 11:06 hgbot Note Added: 0063776
2014-01-29 11:06 hgbot Status new => resolved
2014-01-29 11:06 hgbot Resolution open => fixed
2014-01-29 11:06 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/496cbeb8f989ceabb54b9d0e00c3400dfb2e61d8 [^] => http://code.openbravo.com/erp/devel/pi/rev/b424cda58024897df64fdf1ba1512444bb741038 [^]
2014-01-29 11:09 alostale Note Added: 0063778
2014-02-04 22:39 jecharri Note Added: 0063905
2014-02-12 04:23 shankarb Note Added: 0064070
2014-02-12 04:23 shankarb Status resolved => closed
2014-02-12 04:23 shankarb Fixed in Version => 3.0MP32
2014-02-12 18:29 hudsonbot Checkin
2014-02-12 18:29 hudsonbot Note Added: 0064119
2014-02-12 18:29 hudsonbot Checkin
2014-02-12 18:29 hudsonbot Note Added: 0064133
2018-05-29 16:18 alostale Relationship added related to 0038651
2020-06-18 17:00 shuehner Relationship added related to 0044414


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker