Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Cloned Grouper environment runs slower

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Cloned Grouper environment runs slower

Chronological Thread 
  • From: Shilen Patel <>
  • To: Julio Polo <>, "Hyzer, Chris" <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] Cloned Grouper environment runs slower
  • Date: Fri, 8 Sep 2017 21:43:38 +0000
  • Accept-language: en-US
  • Authentication-results:; spf=none
  • Ironport-phdr: 9a23:l6LYcRLUbpcWo8bHfdmcpTZWNBhigK39O0sv0rFitYgXKv7yrarrMEGX3/hxlliBBdydsKMUzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZPebgFLiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0vRz+s87lkRwPpiCcfNj427mfXitBrjKlGpB6tvgFzz5LIbI2QMvd1Y6HTcs4ARWdZXshfSTFPAp+yYYUMAeoOP+dYoJXyqFYVtxuyGRWgCfnzxjNUmHP727Ax3eQ7EQHB2QwtB88AsHTVrNXxKqgSV/2+wrPSwjXfcfxW3Sr25Y/TchAhoPGMWax/cczKxEYyCgPFjUufpZb7MDyIy+QAqm6W5PduW+Kojm4osQBxoj63y8ctjInJmpwaykrC9Spn3IY5O8e0R1Bmbt65CJdQrzuaN4xxQsMsW2Fovyc6yrsauZKhYCcKz5Enywbaa/yGfIiI+AjsVPqQITd+i3JpYayziA298Ui6ze38S9G030hQriZcjNXDrX4N1wbU6siCU/dx4Fyu2TGJ1w/N8+1IP1s7la/bKp46274wkoMfvVrYES/qn0X6lbGaeV4+9eiu7OTnfrXmqYGGN4JylwrwMbwul9SiDek4LAQCRWaW9f6h2LDg+UD1WqtGg/IonqXBrZzXK8UWqrS5DgJUyIov9gizAy273NkWg3ULNExJdA6FgoTzNFzDIer0Aeq+jlmiijtmyPTLM7v8CZvXNHfDiq3ufbNl5k5c1gUzyddf6opRCr4bIfLzXlb9tNPWDxMgLgC5wvzrCNJ81oMCQ26AH7KZMKDMvlOS+O0gPvSMaJcUuDb7Nfcl++bjgWI5lFMDZ6Wk04EbZG27E/liOUmVf3XhjskZHWcPpAU+TejqiFOYUT5UYna/R7k85jE6CIKiE4jDQJugj6Gc3Ce4AJJafH5JBU2REXvwbYWLR+8MaD6OIs9mijEEWqKhS4g81RG2qgD60aNrLvfP+iIGr5Ljz8N45+nSlREp6Tx0FNqR33uMT2FygmMHWSU23KZhrkxh1FuPy7Z3jOFFFY8b2/QccBo+NJmU9+t+DJimWB/Ff9ChSF+5S9SnRzw9U4R1i5UuclRwAZHqpRDZ3jHgS+sQnLyaFpEu2qPH1D7sP8t7zTDL2LR33Hc8Rc4aDm2ngqN5vzDaG4PN2xGCl6eueKI00DPO+SGOwXfY7xIQaxJ5TaiQBSNXXUDRt9msoxqaF7I=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Analyzing is actually good to do for newly imported databases and even if you make big changes since that is how the database figures out how best to execute queries given your current data.  At Duke, we reanalyze every night.

- Shilen 

-------- Original message --------
From: Julio Polo <>
Date: 9/8/17 5:31 PM (GMT-05:00)
To: "Hyzer, Chris" <>
Subject: Re: [grouper-users] Cloned Grouper environment runs slower

There is 3 to 5 fold improvement within test, but production is still 2 to 3 times faster than test.   I wouldn't have expected a newly imported database to need analyze right off the bat.  I will continue working with our DBA along these lines unless there are other ideas (such as how to minimize the copying to temp tables that we've observed).


On Fri, Sep 8, 2017 at 10:51 AM, Hyzer, Chris <> wrote:
So the analyze fixed it or is there still a problem?

From: Julio Polo <>
Sent: Friday, September 8, 2017 4:25:46 PM
To: Hyzer, Chris
Subject: Re: [grouper-users] Cloned Grouper environment runs slower
Here are the answers provided by our DBA:

Test has 16G of memory compared to 32G for prod.

Same charset for databases.

Indexes the same for both databases.

Ran analyze on all the tables in test, then ran those two queries with these results:

1st SQL:

prod - 0.015 sec. 2531 rows

test - 0.422 sec. 2183 rows

2nd SQL:

prod - 972 sec. 29 rows

test - 921 sec. 38 rows

Explain results:


Inline image 1


Inline image 2



On Wed, Sep 6, 2017 at 2:32 PM, Hyzer, Chris <> wrote:

Do both databases have the same amount of memory?

Are they both innodb and the same charset (utf8) and collation (utf8_bin)?

Are all the indexes on the test db?

Have you analyzed all the tables in the test db?

When you run an explain plan on prod and test for that query what are the results?





From: [mailto:] On Behalf Of Julio Polo
Sent: Wednesday, September 06, 2017 7:08 PM
Subject: [grouper-users] Cloned Grouper environment runs slower


We recently cloned our production Grouper 2.2.2 environment into a test environment, and we've noticed that the test environment is significantly slower compared to production, especially the first time a query is made.  Both environments use MySQL, and we expected the test Grouper and test database to perform better (idle, dedicated database)

We made two calls to getMembersLite:


1) POST /groups/path:to:group:one/members [ with memberFilter => all ]


Test took 13674 ms while production took 1782 ms. Subsequent queries for the same group are much faster and return in about the same amount of time for both environments.


2) POST /groups/path:to:group:two/members [ with memberFilter => all ]


Test took 18044 ms while production took 2348 ms. Subsequent queries for the same group are much faster and return in about the same amount of time for both environments.


The following SQL is for the second query.  It doesn't use temp tables (more on this later).  It took 18 seconds on test but under a second in production:


-- State: Sending data

select as id21_, 

member0_.hibernate_version_number as hibernate2_21_, 

member0_.subject_id as subject3_21_, 

member0_.subject_source as subject4_21_, 

member0_.subject_type as subject5_21_, 

member0_.context_id as context6_21_, 

member0_.sort_string0 as sort7_21_, 

member0_.sort_string1 as sort8_21_, 

member0_.sort_string2 as sort9_21_, 

member0_.sort_string3 as sort10_21_, 

member0_.sort_string4 as sort11_21_, 

member0_.search_string0 as search12_21_, 

member0_.search_string1 as search13_21_, 

member0_.search_string2 as search14_21_, 

member0_.search_string3 as search15_21_, 

member0_.search_string4 as search16_21_, as name21_, 

member0_.description as descrip18_21_ 

from grouper_members member0_ 

cross join grouper_memberships_all_v membership1_ 

where membership1_.owner_group_id='dcacd183a3f04ec99ce1f8dd4e81cd12' 

and membership1_.field_id='97f744eefee9415b9ab94ace9774abf1' 


and membership1_.immediate_mship_enabled='T';


It seems that the very first query triggered a lot of copying to temp tables in the test environment.  The following SQL took a little over 200 seconds total on the test database with temp tables set to 384M.


-- State: Copying to tmp table

select distinct as id20_, 

group0_.hibernate_version_number as hibernate2_20_, 

group0_.last_membership_change as last3_20_, 

group0_.last_imm_membership_change as last4_20_, 

group0_.parent_stem as parent5_20_, 

group0_.creator_id as creator6_20_, 

group0_.create_time as create7_20_, 

group0_.modifier_id as modifier8_20_, 

group0_.modify_time as modify9_20_, as name20_, 

group0_.display_name as display11_20_, 

group0_.extension as extension20_, 

group0_.display_extension as display13_20_, 

group0_.description as descrip14_20_, 

group0_.context_id as context15_20_, 

group0_.alternate_name as alternate16_20_, 

group0_.type_of_group as type17_20_, 

group0_.id_index as id18_20_ 

from grouper_groups group0_ 

cross join grouper_memberships_all_v membership1_ 

cross join grouper_memberships_all_v membership2_ 


and (membership2_.field_id in ('b34f320a98014ef2a39016df8312a16c' , 'ca3b97aa5186446aa8770a18364d388c')) 

and (membership2_.member_id in ('520c350d37db4d0a9b728e56822ffab8' , '39e8f222fa1d434f87d40cc4f0633717')) 

and membership2_.immediate_mship_enabled='T' 

and membership1_.immediate_mship_enabled='T' 


and membership1_.field_id='97f744eefee9415b9ab94ace9774abf1' 

and membership1_.member_id='b75b7c918a6847bbbb0e8c30fe56e776' 

order by group0_.display_name asc;


I don't think we saw the long copying to temp tables when the first query was run against production.  We did try to run the above SQL in production, and it took over 500 seconds before killing it .  Production has 128M temp tables.  Tried changing temp table size on test to 32M, but killed it when it went over 200 seconds.


We expected the test environment to perform better since it is mostly idle and it has a dedicated database (production uses a database server used by many other applications).   Given that test grouper was cloned from production, we would expect performance to be better in test.  This is how we cloned it:



Any ideas on what might be causing the slowness?





Archive powered by MHonArc 2.6.19.

Top of Page