You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Fabio Latrofa <fl...@sivaspa.com> on 2003/04/17 17:30:56 UTC
PSML Browser Portlet performance issue
I noticed a performance issue with PSML Browser Portlet working on DB: the
buildNormalContext method is very slow the first time and also after a
doRefresh action.
I think the problem is in the query(QueryLocator) method of the
DatabasePsmlManagerService class but, to be accurate, the getProfiles(List)
method is also involved. The problem is that, for each profile stored in the
PSML registry, there is a single query executed on the user (or role or
group) table.
Example
Four profiles stored:
- User anon, Media Type html
- User anon, Media Type html, language en
- User admin, Media Type html
- User admin, Media Type html, language en
Five queries executed:
- SELECT JETSPEED_USER_PROFILE.PSML_ID,...FROM JETSPEED_USER_PROFILE ORDER
BY UPPER(JETSPEED_USER_PROFILE.USER_NAME) ASC,...
- SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
TURBINE_USER.LOGIN_NAME='admin'
- SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
TURBINE_USER.LOGIN_NAME='admin'
- SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
TURBINE_USER.LOGIN_NAME='anon'
- SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
TURBINE_USER.LOGIN_NAME='anon'
I think there could be at least two different solutions but I'm not sure
about side effects.
First solution: to change the query(QueryLocator) method of
DatabasePsmlManagerService and extract profiles with a single db access:
JETSPEED_USER_PROFILE and TURBINE_USER might be joined but there will be
problems with, for example, an LDAP user authentication.
Second solution: to change the query(QueryLocator) method of
DatabasePsmlManagerService and extract profiles with lightweight version of
JetspeedUser object: an instance containing only the user name. This one
seems better to me but I'm not sure about possible drawbacks.
I would like to receive your opinion and suggestions about the problem and
the possible solutions. Thanks.
Regards,
Fabio Latrofa
SIVA S.p.A
Mail: flatrofa@sivaspa.com
Questa e-mail e' stata verificata dal sistema di antivirus della Siva S.P.A.
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: PSML Browser Portlet performance issue
Posted by Fabio Latrofa <fl...@sivaspa.com>.
----- Original Message -----
From: "David Sean Taylor" <da...@bluesunrise.com>
To: "Jetspeed Developers List" <je...@jakarta.apache.org>
Sent: Thursday, April 17, 2003 9:07 PM
Subject: Re: PSML Browser Portlet performance issue
>
> On Thursday, April 17, 2003, at 08:30 AM, Fabio Latrofa wrote:
>
> > I noticed a performance issue with PSML Browser Portlet working on DB:
> > the
> > buildNormalContext method is very slow the first time and also after a
> > doRefresh action.
>
> I haven't really noticed it being that slow against the db here (Oracle)
> How slow is slow?
>
It was realy slow (more than 1 minute to get a response), but this mourning
I double checked and, to tell you the truth, there was also a concurrent
process that was running on the same machine. The concurrent process was
consuming about 80% of cpu time. Now PSML Browser Portlet is fast enough
(about 10 seconds to get a response).
I'm sorry but I thought my tomcat was the only application running during
tests.
Anyway...
> > Five queries executed:
> > - SELECT JETSPEED_USER_PROFILE.PSML_ID,...FROM JETSPEED_USER_PROFILE
> > ORDER
> > BY UPPER(JETSPEED_USER_PROFILE.USER_NAME) ASC,...
> > - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> > TURBINE_USER.LOGIN_NAME='admin'
> > - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> > TURBINE_USER.LOGIN_NAME='admin'
> > - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> > TURBINE_USER.LOGIN_NAME='anon'
> > - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> > TURBINE_USER.LOGIN_NAME='anon'
> >
>
> I thought there should be 3 queries against: JETSPEED_USER_PROFILE,
> JETSPEED_GROUP_PROFILE, and JETSPEED_ROLE_PROFILE
> One optimization that I've been considering is to combine these 3
> tables.
>
> Are you sure that the queries against TURBINE_USER are generated from
> the DatabasePsmlManagerService?
Well, I'm pretty sure about the queries and you are right, there are 3
queries against: JETSPEED_USER_PROFILE, JETSPEED_GROUP_PROFILE, and
JETSPEED_ROLE_PROFILE; but also:
- for each profile in JETSPEED_USER_PROFILE there is a query on TURBINE_USER
- for each profile in JETSPEED_GROUP_PROFILE there is a query on
TURBINE_GROUP
- for each profile in JETSPEED_ROLE_PROFILE there is a query on TURBINE_ROLE
I will privately send you a portion of the torque.log file (the
portion involved in the operation).
Now I'm no more sure about the problem. Do you think there might be
performance issues with hundreds of user?
Regards,
Fabio Latrofa
SIVA S.p.A
Mail: flatrofa@sivaspa.com
Questa e-mail e' stata verificata dal sistema di antivirus della Siva S.P.A.
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: PSML Browser Portlet performance issue
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Thursday, April 17, 2003, at 08:30 AM, Fabio Latrofa wrote:
> I noticed a performance issue with PSML Browser Portlet working on DB:
> the
> buildNormalContext method is very slow the first time and also after a
> doRefresh action.
I haven't really noticed it being that slow against the db here (Oracle)
How slow is slow?
> I think the problem is in the query(QueryLocator) method of the
> DatabasePsmlManagerService class but, to be accurate, the
> getProfiles(List)
> method is also involved. The problem is that, for each profile stored
> in the
> PSML registry, there is a single query executed on the user (or role or
> group) table.
>
> Example
> Four profiles stored:
> - User anon, Media Type html
> - User anon, Media Type html, language en
> - User admin, Media Type html
> - User admin, Media Type html, language en
>
> Five queries executed:
> - SELECT JETSPEED_USER_PROFILE.PSML_ID,...FROM JETSPEED_USER_PROFILE
> ORDER
> BY UPPER(JETSPEED_USER_PROFILE.USER_NAME) ASC,...
> - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> TURBINE_USER.LOGIN_NAME='admin'
> - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> TURBINE_USER.LOGIN_NAME='admin'
> - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> TURBINE_USER.LOGIN_NAME='anon'
> - SELECT TURBINE_USER.USER_ID, ... FROM TURBINE_USER WHERE
> TURBINE_USER.LOGIN_NAME='anon'
>
I thought there should be 3 queries against: JETSPEED_USER_PROFILE,
JETSPEED_GROUP_PROFILE, and JETSPEED_ROLE_PROFILE
One optimization that I've been considering is to combine these 3
tables.
Are you sure that the queries against TURBINE_USER are generated from
the DatabasePsmlManagerService?
>
> I think there could be at least two different solutions but I'm not
> sure
> about side effects.
>
> First solution: to change the query(QueryLocator) method of
> DatabasePsmlManagerService and extract profiles with a single db
> access:
> JETSPEED_USER_PROFILE and TURBINE_USER might be joined but there will
> be
> problems with, for example, an LDAP user authentication.
Not sure where we are hitting the TURBINE_USER table directly.
Look at the DatabasePsmlManagerService.query method.
It makes three calls to the selectedOrdered method on the
Jetspeed[user/role/group]ProfilerPeer class, which doesn't select from
TURBINE_USER
>
> Second solution: to change the query(QueryLocator) method of
> DatabasePsmlManagerService and extract profiles with lightweight
> version of
> JetspeedUser object: an instance containing only the user name. This
> one
> seems better to me but I'm not sure about possible drawbacks.
>
Or at least lazy load the BLOB until needed.
> I would like to receive your opinion and suggestions about the problem
> and
> the possible solutions. Thanks.
>
> Regards,
>
> Fabio Latrofa
> SIVA S.p.A
> Mail: flatrofa@sivaspa.com
>
>
> Questa e-mail e' stata verificata dal sistema di antivirus della Siva
> S.P.A.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
>
>
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org