Unknown Node allocated cpu, ram, disk #135

Closed
opened 2026-02-04 16:50:26 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @rmartinoscar on GitHub (Jul 19, 2024).

Current Behavior

Those vars are never updated due to e634dd8 & 50fa260 so we don't have any way of summing allocated resources which is really annoying when you want to use Limits (should be done whenever we create/update a server to avoid flooding querys)
56b4938dc2/app/Models/Node.php (L137-L139)

Expected Behavior

Those variables should represent the sum of resources allocated to servers on this node

Steps to Reproduce

None, i just tried to duplicate https://github.com/pelican-dev/panel/pull/459 but for allocated resources and not the ones being in use atm

Panel Version

1.0.0-beta6

Wings Version

1.0.0-beta3

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

No response

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
Originally created by @rmartinoscar on GitHub (Jul 19, 2024). ### Current Behavior Those vars are never updated due to [e634dd8](https://github.com/pelican-dev/panel/commit/e634dd81b1ff45102d65c6a58f26a1fdd7024e59#diff-a4edc5f1b41c92e105baab86f8c39c1787d3875a315a1c2503d4493af530d750) & [50fa260](https://github.com/pelican-dev/panel/commit/50fa260a382a52ae6c668dc4b798b5f940a0019e#diff-a4edc5f1b41c92e105baab86f8c39c1787d3875a315a1c2503d4493af530d750R38) so we don't have any way of summing allocated resources which is really annoying when you want to use Limits (should be done whenever we create/update a server to avoid flooding querys) https://github.com/pelican-dev/panel/blob/56b4938dc2b3b38dc731d929e37c869f0c21ab4b/app/Models/Node.php#L137-L139 ### Expected Behavior Those variables should represent the sum of resources allocated to servers on this node ### Steps to Reproduce None, i just tried to duplicate https://github.com/pelican-dev/panel/pull/459 but for allocated resources and not the ones being in use atm ### Panel Version 1.0.0-beta6 ### Wings Version 1.0.0-beta3 ### Games and/or Eggs Affected _No response_ ### Docker Image _No response_ ### Error Logs _No response_ ### Is there an existing issue for this? - [X] I have searched the existing issues before opening this issue. - [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server. - [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
Author
Owner

@Boy132 commented on GitHub (Jul 19, 2024):

This is intented. These variables are only used when checking if the node is viable.
https://github.com/pelican-dev/panel/blob/main/app/Services/Deployment/FindViableNodesService.php#L22-L25
https://github.com/pelican-dev/panel/blob/main/app/Models/Node.php#L245-L269

@Boy132 commented on GitHub (Jul 19, 2024): This is intented. These variables are only used when checking if the node is viable. https://github.com/pelican-dev/panel/blob/main/app/Services/Deployment/FindViableNodesService.php#L22-L25 https://github.com/pelican-dev/panel/blob/main/app/Models/Node.php#L245-L269
Author
Owner

@rmartinoscar commented on GitHub (Jul 19, 2024):

I know but we don't get any info on what's allocated then ?
And it doesn't change that those values are ALWAYS 0 so we can change those and their declaration aswell.

if ($this->memory_overallocate >= 0) {
    $memoryLimit = $this->memory * (1 + ($this->memory_overallocate / 100));
    if ($this->servers_sum_memory + $memory > $memoryLimit) {
        return false;
    }
}

if ($this->disk_overallocate >= 0) {
    $diskLimit = $this->disk * (1 + ($this->disk_overallocate / 100));
    if ($this->servers_sum_disk + $disk > $diskLimit) {
        return false;
    }
}

if ($this->cpu_overallocate >= 0) {
    $cpuLimit = $this->cpu * (1 + ($this->cpu_overallocate / 100));
    if ($this->servers_sum_cpu + $cpu > $cpuLimit) {
        return false;
    }
}

Like so

if ($this->memory_overallocate >= 0) {
    $memoryLimit = $this->memory * (1 + ($this->memory_overallocate / 100));
    if ($memory > $memoryLimit) {
        return false;
    }
}

if ($this->disk_overallocate >= 0) {
    $diskLimit = $this->disk * (1 + ($this->disk_overallocate / 100));
    if ($disk > $diskLimit) {
        return false;
    }
}

if ($this->cpu_overallocate >= 0) {
    $cpuLimit = $this->cpu * (1 + ($this->cpu_overallocate / 100));
    if ($cpu > $cpuLimit) {
        return false;
    }
}
@rmartinoscar commented on GitHub (Jul 19, 2024): I know but we don't get any info on what's allocated then ? And it doesn't change that those values are ALWAYS 0 so we can change those and their declaration aswell. ```php if ($this->memory_overallocate >= 0) { $memoryLimit = $this->memory * (1 + ($this->memory_overallocate / 100)); if ($this->servers_sum_memory + $memory > $memoryLimit) { return false; } } if ($this->disk_overallocate >= 0) { $diskLimit = $this->disk * (1 + ($this->disk_overallocate / 100)); if ($this->servers_sum_disk + $disk > $diskLimit) { return false; } } if ($this->cpu_overallocate >= 0) { $cpuLimit = $this->cpu * (1 + ($this->cpu_overallocate / 100)); if ($this->servers_sum_cpu + $cpu > $cpuLimit) { return false; } } ``` Like so ```php if ($this->memory_overallocate >= 0) { $memoryLimit = $this->memory * (1 + ($this->memory_overallocate / 100)); if ($memory > $memoryLimit) { return false; } } if ($this->disk_overallocate >= 0) { $diskLimit = $this->disk * (1 + ($this->disk_overallocate / 100)); if ($disk > $diskLimit) { return false; } } if ($this->cpu_overallocate >= 0) { $cpuLimit = $this->cpu * (1 + ($this->cpu_overallocate / 100)); if ($cpu > $cpuLimit) { return false; } } ```
Author
Owner

@Boy132 commented on GitHub (Jul 19, 2024):

They aren't always 0?
grafik

@Boy132 commented on GitHub (Jul 19, 2024): They aren't always 0? ![grafik](https://github.com/user-attachments/assets/02cc3a77-5b61-4be4-b999-5679411cc299)
Author
Owner

@rmartinoscar commented on GitHub (Jul 19, 2024):

Well i must have missed something because i was always getting 0 out of them until i redid the query

@rmartinoscar commented on GitHub (Jul 19, 2024): Well i must have missed something because i was always getting 0 out of them until i redid the query
Author
Owner

@Boy132 commented on GitHub (Jul 19, 2024):

Yes, because they are only filled when running that query. They are just temp variables for the query, basically.
The withSum is the magical part here.

@Boy132 commented on GitHub (Jul 19, 2024): Yes, because they are only filled when running that query. They are just temp variables for the query, basically. The `withSum` is the magical part here.
Author
Owner

@rmartinoscar commented on GitHub (Jul 19, 2024):

I see well i'll sleep slightly less dumb sorry for the inconvenience

@rmartinoscar commented on GitHub (Jul 19, 2024): I see well i'll sleep slightly less dumb sorry for the inconvenience
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#135