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

WIP: Feat: optimize argocd-server #21334

Open
wants to merge 1 commit into
base: release-2.11
Choose a base branch
from

Conversation

ezxfv
Copy link

@ezxfv ezxfv commented Dec 30, 2024

Features:

  • add zstd support, reduce list data size (9500 applications only cost 388kb)
  • optimize list page, support 10w+ applications (I only tested 10w application in my local cluster, maybe supports more!)

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@@ -249,7 +249,7 @@ func NewCommand() *cobra.Command {
command.Flags().StringVar(&dexServerAddress, "dex-server", env.StringFromEnv("ARGOCD_SERVER_DEX_SERVER", common.DefaultDexServerAddr), "Dex server address")
command.Flags().BoolVar(&disableAuth, "disable-auth", env.ParseBoolFromEnv("ARGOCD_SERVER_DISABLE_AUTH", false), "Disable client authentication")
command.Flags().StringVar(&contentTypes, "api-content-types", env.StringFromEnv("ARGOCD_API_CONTENT_TYPES", "application/json", env.StringFromEnvOpts{AllowEmpty: true}), "Semicolon separated list of allowed content types for non GET api requests. Any content type is allowed if empty.")
command.Flags().BoolVar(&enableGZip, "enable-gzip", env.ParseBoolFromEnv("ARGOCD_SERVER_ENABLE_GZIP", true), "Enable GZIP compression")
command.Flags().BoolVar(&enableCompress, "enable-gzip", env.ParseBoolFromEnv("ARGOCD_SERVER_ENABLE_COMPRESS", true), "Enable compression")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change, let's keep the env variable for enable gzip.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it


a.Annotations = nil
return a
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we prune application? Would those fields not be useful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these fields are unnecessary. When clicking the application card, the entire application will be requested again. However, to maintain compatibility with existing code that might already use the list interface, a prune parameter should be added, and the UI should include this parameter in its requests.

return
}

if isChromeVersionAtLeast(request.Header.Get("User-Agent"), 123) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment why version 123 is picked?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other browsers support zstd now, it looks like: https://caniuse.com/zstd

@@ -25,7 +25,7 @@ import {useSidebarTarget} from '../../../sidebar/sidebar';
import './applications-list.scss';
import './flex-top-bar.scss';

const EVENTS_BUFFER_TIMEOUT = 500;
const EVENTS_BUFFER_TIMEOUT = 2000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the number of applications is too large, updates are triggered in almost every 500ms cycle. Could the interval here be adjusted based on the number of applications listed in the previous step, with several different values to choose from? This would sacrifice some real-time performance to ensure smoother page performance.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the main optimization point; perhaps I should just revert it for now?

@ezxfv ezxfv force-pushed the optimize/argocd-server branch from 5b10f7f to cb5f562 Compare January 2, 2025 02:35
@ezxfv ezxfv force-pushed the optimize/argocd-server branch from cb5f562 to bc72888 Compare January 2, 2025 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants