Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/api/v1/applications takes significant amount of time #4296

Closed
cedricboesiger opened this issue Sep 10, 2020 · 21 comments
Closed

/api/v1/applications takes significant amount of time #4296

cedricboesiger opened this issue Sep 10, 2020 · 21 comments
Labels
bug Something isn't working
Milestone

Comments

@cedricboesiger
Copy link

Describe the bug
The application list page uses GET /api/v1/applications?fields=... which, depending on the number of projects holding OIDC groups, requires more time to answer the request.
In our environment, it already takes between 12s-14s to answer the request.

network-duration (1)

We count:

  • Between 50 to 70 OIDC groups per user
  • 25 Appprojects each with 2 roles with up to 10 policies that are assigned to 1 oidc group.
  • 215 Applications
  • We use v1.5.6 in production

To Reproduce

  • Create an empty ArgoCD installation, v1.7.4
  • Create a couple 100 Appprojects, each with 2 roles that are assigned to an OIDC group
  • Create a couple 100 Applications assigned to the Appprojects
  • Use an OpenID User to login
  • Check that the response time from /api/v1/applications in the browser console increases with the number of projects with assigned groups.

Expected behavior

A response time that is less dependent on the number of applications, projects and groups involved.

@cedricboesiger cedricboesiger added the bug Something isn't working label Sep 10, 2020
@cedricboesiger cedricboesiger changed the title /api/v1/applications takes significat amount of time /api/v1/applications takes significant amount of time Sep 10, 2020
@asvasyanin
Copy link

Same issue, we are using v1.7.4

@asvasyanin
Copy link

Also, I've notice, that if login using built-in account to the same api server response more quickly.

@asvasyanin
Copy link

We have about 800+ applications in 2 clusters.
My results with SSO login and RBAC:
argocd1

Using built-in administrator account:
argocd2

@jessesuen jessesuen added this to the v1.8 milestone Sep 17, 2020
@jessesuen
Copy link
Member

NOTE: The admin is special because it has no groups and therefore enforcement is simpler.

Between 50 to 70 OIDC groups per user

I think we need an optimization to use a temporary map to lookup oidc groups rather than current implementation to iterate the groups list

@boskoop
Copy link

boskoop commented Oct 14, 2020

Great news if this is solved with 1.8!

@alexmt alexmt assigned alexmt and unassigned alexmt Oct 15, 2020
@alexmt alexmt modified the milestones: v1.8, v1.9 Nov 20, 2020
@kshamajain99
Copy link
Contributor

Looking into this.

@kshamajain99 kshamajain99 removed their assignment Feb 2, 2021
@rbreeze
Copy link
Member

rbreeze commented Feb 5, 2021

#5342 is a workaround for this, but ideally we should still implement a map for OIDC group lookup

@rbreeze rbreeze self-assigned this Feb 5, 2021
@rbreeze rbreeze removed this from the v1.9 milestone Feb 5, 2021
@rbreeze rbreeze added the wontfix This will not be worked on label Feb 5, 2021
@rbreeze
Copy link
Member

rbreeze commented Feb 5, 2021

Discussed with @jessesuen and we feel pagination addresses the user experience of slow loading apps.

@rbreeze rbreeze removed their assignment Feb 5, 2021
@jessesuen jessesuen removed the wontfix This will not be worked on label Feb 11, 2021
@alexmt alexmt added this to the v2.1 milestone Mar 17, 2021
@alexmt alexmt modified the milestones: v2.1, v2.2 Jul 2, 2021
farodin91 added a commit to farodin91/argo-cd that referenced this issue Jul 16, 2021
Part of: argoproj#4296

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
@jgwest jgwest modified the milestones: v2.2, v2.1 Jul 22, 2021
alexmt pushed a commit that referenced this issue Jul 26, 2021
* chore: pre filter groups before enforcing

Part of: #4296

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* chore: prevent serialization if it is a mapclaims

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>

* add comments

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
@alexmt
Copy link
Collaborator

alexmt commented Jul 29, 2021

Hello @cedricboesiger, @boskoop ,

The v2.1 has a optimization that is supposed to significantly improve API server performance. The change is available in https://github.com/argoproj/argo-cd/releases/tag/v2.1.0-rc1. Can you give it a try please?

@alexmt
Copy link
Collaborator

alexmt commented Aug 20, 2021

Closing and will reopen if someone reproduce issue again

@alexmt alexmt closed this as completed Aug 20, 2021
@limoges
Copy link

limoges commented Sep 10, 2021

We had very high hopes that this would be fixed with v2.1 and I've come around to making the update to v2.1.2.

Unfortunately, the performance issue is still there. I didn't measure before the update but I don't notice any difference.
image

We have ~1000 applications.

@matoous
Copy link

matoous commented Sep 10, 2021

Can confirm, the load time is still slow
Screen Shot 2021-09-10 at 13 56 04

@alexmt alexmt reopened this Sep 10, 2021
@alexmt alexmt modified the milestones: v2.1, v2.2 Sep 10, 2021
@alexmt
Copy link
Collaborator

alexmt commented Sep 10, 2021

Thank you @matoous and @limoges ! Reopening ticket. Will attack it in 2.2 again

@yydzhou
Copy link

yydzhou commented Oct 6, 2021

@alexmt is there any progress on the overall application list slowness issue? we have 4k applications now and the application listing cost about 8-10 seconds at least, even if we only assign an admin role to the user.

alexmt pushed a commit that referenced this issue Nov 3, 2021
feat: cache argo cd rbac (#7587)

Part of: #4296

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
Signed-off-by: pashavictorovich <pavel@codefresh.io>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
lukpep pushed a commit to lukpep/argo-cd that referenced this issue Nov 3, 2021
feat: cache argo cd rbac (argoproj#7587)

Part of: argoproj#4296

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
Signed-off-by: pashavictorovich <pavel@codefresh.io>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: lukasz.peplinski <lukpep@gmail.com>
@alexmt
Copy link
Collaborator

alexmt commented Jan 1, 2022

@yydzhou the API was improved in v2.2. During performance testing, we've reduced API response time from 10 seconds to ~0.5 seconds. Can you please give it a try?

@alexmt alexmt closed this as completed Jan 1, 2022
@amitde69
Copy link
Contributor

still happens on v2.3.3 with 23 clusters and 1612 applications.

@wgzhao
Copy link
Contributor

wgzhao commented Sep 3, 2022

still happens on v2.4.6 with 10 clusters and 50 applications

@sidewinder12s
Copy link

With v2.4.17 it can still take 5+ seconds for 1000+ apps to load

@jujubetsz
Copy link

Same here. 3k+ apps, 1 cluster, v2.4.11

Sometimes it take 30s+ :sad:

@crenshaw-dev
Copy link
Collaborator

Would y'all be willing to test this? #11884

@jenting
Copy link
Contributor

jenting commented Jun 7, 2023

Does the endpoint /api/v1/applications support pagination?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests