Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vasu Kumar Piduru
Too many hibernate queries
July 8, 2013 2:02 PM
Answer

Vasu Kumar Piduru

Rank: New Member

Posts: 23

Join Date: October 5, 2009

Recent Posts

Hi Team,

We have weired problem with login process, when a user is trying to login to the system it takes too much time by firing queries as attached in the file.

What would be the reason to fire these many queries, its all related to resource permissions. We have around 400+ roles in the liferay, would this cause liferay to fire these many queries?


Thanks
Vasu
Attachments: queries_from_log.txt (4,533.3k)
Sampsa Sohlman
RE: Too many hibernate queries
July 9, 2013 4:45 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 219

Join Date: September 27, 2007

Recent Posts

Hi Vasu,

Which version of Liferay you are running?

It seems that your Resource permission queries does not hit to cache.

Sunny summer regards,

Sampsa
Vasu Kumar Piduru
RE: Too many hibernate queries
July 9, 2013 6:37 AM
Answer

Vasu Kumar Piduru

Rank: New Member

Posts: 23

Join Date: October 5, 2009

Recent Posts

Thank you for youre response.

The version of liferay we are using is 6.0.6 CE, deployed on tomcat and the database used is Oracle.

If I have to force Resource Permissions to fetch from cache instead of database what changes should be made in the configuration.

Thanks
Vasu
Sampsa Sohlman
RE: Too many hibernate queries
July 10, 2013 5:45 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 219

Join Date: September 27, 2007

Recent Posts

Hi Vasu,

Liferay 6.1.1 permission management has been improved and it makes less queries on database compared to Liferay 6.0.6.
Vasu Kumar Piduru
RE: Too many hibernate queries
July 10, 2013 2:12 PM
Answer

Vasu Kumar Piduru

Rank: New Member

Posts: 23

Join Date: October 5, 2009

Recent Posts

Hi thank you verymuch for your response.

could you please confirm the below points please.

1. These queries are delaying the user login, user who has more roles is taking long time to login.
NOTE: We read user roles from DB and set them to liferay at the time of user login.
2. We have around 300+ roles created in liferay, is this causing to execute these many queries?

3. Any way to control this in behavious in 6.0.6?

4. Unfortunately we can't upgrade to 6.1, so do you have any suggestions for us?

Kindly answers the points, which would help us to conclude.


Thanks
Vasu
Sampsa Sohlman
RE: Too many hibernate queries
July 12, 2013 4:04 PM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 219

Join Date: September 27, 2007

Recent Posts

Hi Vasu,

Vasu Kumar Piduru:
could you please confirm the below points please.


I have encountered similar kind of case and symptoms where same. It was also 6.0.x portal. We managed to get better performance by upgrading to 6.1.x.

Vasu Kumar Piduru:
1. These queries are delaying the user login, user who has more roles is taking long time to login.
NOTE: We read user roles from DB and set them to liferay at the time of user login.
2. We have around 300+ roles created in liferay, is this causing to execute these many queries?


If your role amount will rise then your performance will degrade even more.

Vasu Kumar Piduru:
3. Any way to control this in behavious in 6.0.6?


Control amount of the roles that you are having. Less roles better. You can also try to verify that everything is on cache and tune your cache settling accordingly. Anyway, if your users are logging in rarely. You might to make somekind of mechanism to fill cache after every restart of the portal.

Vasu Kumar Piduru:
4. Unfortunately we can't upgrade to 6.1, so do you have any suggestions for us?


To fix this you needs code/move changes to your portal, so I the migration path to 6.1.x would be better.

You can take a look issues from our JIRA http://issue.liferay.com , but I don't know the solving issue(s) for this.

Kind regards,

Sampsa
David H Nebinger
RE: Too many hibernate queries
July 12, 2013 4:21 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8425

Join Date: September 1, 2006

Recent Posts

Vasu Kumar Piduru:
We have around 300+ roles created in liferay, is this causing to execute these many queries?


If I shoot myself in the foot, would that be the cause of my limping?

Sorry, couldn't help it...

If you have 300+ roles, then I think you've done some things wrong. I can't imagine why you would ever need so many unless you were being overly-granular with your roles...