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

Takes a long time to display a page after selecting "Edit" on a Proxmox host #395

Open
btoneill opened this issue Feb 4, 2025 · 0 comments

Comments

@btoneill
Copy link

btoneill commented Feb 4, 2025

Describe the bug
When editing a host that is using Proxmox in Foreman it takes a long time for the edit pages to render. Currently on one of my Proxmox clusters it takes around 30 seconds.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Host
  2. Click on 'Edit'
  3. Wait....

Expected behavior
Get to screen very quickly

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: RHEL 9.5
  • Browser chrome

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
I have tracked down the issue to the app/views/compute_resources_vms/form/proxmox/_base.html.erb template. In particular the "react_component('ProxmoxVmType', { " function and it's use of to_json. Basically the entire configuration from every proxmox node is sent thru this function call and it takes about 30 seconds in my current environment to convert to json. Current cluster is 8 nodes and around 100 VMs. One of the largest parts of the nodes is every backup image is listed in the config as well. My debugging has shown on my cluster that when you render _base.html.erb we are converting around 6,000 Fog::Proxmox::Compute objects to json.

From debug logs:
2025-02-04T16:11:02 [D|app|a71008da] Rendered foreman_fog_proxmox/app/views/compute_resources_vms/form/proxmox/_base.html.erb (Duration: 24760.8ms | Allocations: 1900437)

While the biggest culprit in this is the nodes hash, there are others that are very large and not sure have any place being used in editing a VMs configuration. I've been trying to figure out how to make these smaller, but, I'm still very weak on how all this is setup and hoping someone has a quick "oh, I know the quick fix" for this.

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

No branches or pull requests

1 participant