Slowdown with /Users queries starting in 4.5.0
See original GitHub issueWe’ve noticed some slowdowns with UAA on a dev deployment of PCF where ERT was upgraded from https://docs.pivotal.io/pivotalcf/1-11/pcf-release-notes/runtime-rn.html#1.11.5 (w/UAA 4.1.0) to https://docs.pivotal.io/pivotalcf/1-11/pcf-release-notes/runtime-rn.html#1.11.12 (w/UAA 4.5.0). After the upgrade queries to /Users
seem to take really long. For e.g. a root zone with 40+ users takes around 20+ seconds to return result to /Users
query. I was able to reproduce the same thing with UAA apps on PCF dev, one app is 4.4.0 and one is 4.5.0… I couldn’t get them to run against mysql (which is what we’re using and likely make things slightly slower I’m guessing) for some reason, so they’re using the in memory hsqldb but I can still see the performance diff. The same query (list 200 users) done against uaa 4.4.0 takes ~600ms, but takes 8-9 seconds on the 4.5.0 app.
Reproduction steps… 4.4.0 app
git clone https://github.com/cloudfoundry/uaa.git
cd uaa
git checkout tags/4.4.0 -b 4.4.0
./gradlew clean package
./gradlew manifests -Dapp=uaa440 -Dapp-domain=local.pcfdev.io
cf push uaa440 -f build/sample-manifests/uaa-cf-application.yml
uaac target https://uaa440.local.pcfdev.io
uaac token client get admin -s adminsecret
for num in {1..200}; do user=user${num}; echo "$user"; uaac user add user${num} -p password --email "$user@test.io"; done
timing w/4.4.0…
13:47 $ python -m timeit "__import__('os').system('uaac users --count 200 >/dev/null')"
10 loops, best of 3: 585 msec per loop
4.5.0 app
git clone https://github.com/cloudfoundry/uaa.git
cd uaa
git checkout tags/4.5.0 -b 4.5.0
./gradlew clean package
./gradlew manifests -Dapp=uaa450 -Dapp-domain=local.pcfdev.io
cf create-service p-mysql 512mb uaa450-db
cf push uaa450 -f build/sample-manifests/uaa-cf-application.yml
uaac target --skip-ssl-validation https://uaa450.local.pcfdev.io
uaac token client get admin -s adminsecret
for num in {1..200}; do user=user${num}; echo "$user"; uaac user add user${num} -p password --email "$user@test.io"; done
timing w/4.5.0…
13:51 $ python -m timeit "__import__('os').system('uaac users --count 200 >/dev/null')"
10 loops, best of 3: 8.51 sec per loop
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top GitHub Comments
Fixed via https://github.com/cloudfoundry/uaa/commit/c793bb07060a552c968e95be8e9ddce0766558aa
@drennalls not familiar with the cf-java-client, so not sure how to pass in query arguments.
Let me know if
develop
has restored what you were looking for. I believe 4.4.0 had an in memory cache. we now have the similar cache, the new one has expiring values to save server side resources.