Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ranger Web UI is loading very slow and Policies take long time to load

Ranger Web UI is loading very slow and Policies take long time to load

Hi Team,

When i try login to ranger UI it takes time to load. Also I when i click on adding/deleting/modifying new policies, the policy page takes lot lot lot of time to open.

I check ranger database and found that the table size of "x_group_users" is almost 160MB.

Do you think 160Mb is something very large which can create problem for Ranger policy page to be very slow ?

If "Yes" - can you suggest how to tweak mysql server to handle big tables and huge row/column count by ranger. We are using the default mysql setup.

This is on priority for me.

4 REPLIES 4

Re: Ranger Web UI is loading very slow and Policies take long time to load

Expert Contributor
There was a bug in 2.2.4 which cause duplicates in x_group_users. It is fix in 2.2.8 and above
Please try the below. Take a backup of x_group_users before that. If its related to any customer I recommend for upgrade.

Temporary fix. 

1] select count(*) from x_group_users a where exists (select 1 from x_group_users b where a.p_group_id = b.p_group_id and a.user_id = b.user_id and a.id > b.id) ==> this will give you duplicate count. 
2] create table tempfordupes select id from x_group_users a where exists (select 1 from x_group_users b where a.p_group_id = b.p_group_id and a.user_id = b.user_id and a.id >b.id); ==> this will create a temp table with only the duped rows 
3] delete from x_group_users where id in (select id from tempfordupes); ==> this should delete the dupes 
After the delete, query 1 should return you no data. 
If you run user sync again, it might put duplicate data again, so please check. 

Re: Ranger Web UI is loading very slow and Policies take long time to load

@Ramesh Mani

When i ran the 1 command i got the o/p below -

====

select count(*) from x_group_users a where exists (select 1 from x_group_users b where a.p_group_id = b.p_group_id and a.user_id = b.user_id and a.id > b.id);

+----------+

| count(*) |

+----------+

| 8 |

+----------+

1 row in set (0.00 sec)

====

Is it means i still have duplicate entries in the table x_group_users, is that correct ?

Re: Ranger Web UI is loading very slow and Policies take long time to load

Hi @Ramesh Mani

I am currently using Ambari 2.2 and HDP 2.3.0 version.

Do you still think this can be issue ?

Re: Ranger Web UI is loading very slow and Policies take long time to load

Expert Contributor

I don't think this is the issue in HDP 2.3. But number of records in x_group_user will cause performance issue. Is this usersync done with LDAP and brought in a lot of users into ranger? you need to see whether all those users are need for policy authoring.