diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index 8bcb1039..6f8e106e 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -262,7 +262,7 @@ class ServersController extends Controller { $this->buildModificationService->handle($server, $request->only([ 'allocation_id', 'add_allocations', 'remove_allocations', - 'memory', 'swap', 'io', 'cpu', 'disk', + 'memory', 'swap', 'io', 'cpu', 'threads', 'disk', 'database_limit', 'allocation_limit', 'oom_disabled', ])); $this->alert->success(trans('admin/server.alerts.build_updated'))->flash(); diff --git a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php index d386f585..32f68bd2 100644 --- a/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php +++ b/app/Http/Requests/Api/Application/Servers/StoreServerRequest.php @@ -49,6 +49,7 @@ class StoreServerRequest extends ApplicationApiRequest 'limits.swap' => $rules['swap'], 'limits.disk' => $rules['disk'], 'limits.io' => $rules['io'], + 'limits.threads' => $rules['threads'], 'limits.cpu' => $rules['cpu'], // Application Resource Limits @@ -96,6 +97,7 @@ class StoreServerRequest extends ApplicationApiRequest 'disk' => array_get($data, 'limits.disk'), 'io' => array_get($data, 'limits.io'), 'cpu' => array_get($data, 'limits.cpu'), + 'threads' => array_get($data, 'limits.threads'), 'skip_scripts' => array_get($data, 'skip_scripts', false), 'allocation_id' => array_get($data, 'allocation.default'), 'allocation_additional' => array_get($data, 'allocation.additional'), diff --git a/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php b/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php index 9d5a3bb0..3f0e1c8c 100644 --- a/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php +++ b/app/Http/Requests/Api/Application/Servers/UpdateServerBuildConfigurationRequest.php @@ -25,6 +25,7 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest 'limits.swap' => $this->requiredToOptional('swap', $rules['swap'], true), 'limits.io' => $this->requiredToOptional('io', $rules['io'], true), 'limits.cpu' => $this->requiredToOptional('cpu', $rules['cpu'], true), + 'limits.threads' => $this->requiredToOptional('threads', $rules['threads'], true), 'limits.disk' => $this->requiredToOptional('disk', $rules['disk'], true), // Legacy rules to maintain backwards compatable API support without requiring @@ -35,6 +36,7 @@ class UpdateServerBuildConfigurationRequest extends ServerWriteRequest 'swap' => $this->requiredToOptional('swap', $rules['swap']), 'io' => $this->requiredToOptional('io', $rules['io']), 'cpu' => $this->requiredToOptional('cpu', $rules['cpu']), + 'threads' => $this->requiredToOptional('threads', $rules['threads']), 'disk' => $this->requiredToOptional('disk', $rules['disk']), 'add_allocations' => 'bail|array', diff --git a/app/Services/Servers/BuildModificationService.php b/app/Services/Servers/BuildModificationService.php index 0e3085dc..0a010b54 100644 --- a/app/Services/Servers/BuildModificationService.php +++ b/app/Services/Servers/BuildModificationService.php @@ -98,6 +98,7 @@ class BuildModificationService 'swap' => array_get($data, 'swap'), 'io' => array_get($data, 'io'), 'cpu' => array_get($data, 'cpu'), + 'threads' => array_get($data, 'threads'), 'disk' => array_get($data, 'disk'), 'allocation_id' => array_get($data, 'allocation_id'), 'database_limit' => array_get($data, 'database_limit'), diff --git a/app/Services/Servers/ServerConfigurationStructureService.php b/app/Services/Servers/ServerConfigurationStructureService.php index 9984e3a9..91955892 100644 --- a/app/Services/Servers/ServerConfigurationStructureService.php +++ b/app/Services/Servers/ServerConfigurationStructureService.php @@ -81,6 +81,7 @@ class ServerConfigurationStructureService 'swap' => $server->swap, 'io_weight' => $server->io, 'cpu_limit' => $server->cpu, + 'cpu_threads' => $server->threads, 'disk_space' => $server->disk, ], 'service' => [ @@ -130,6 +131,7 @@ class ServerConfigurationStructureService 'swap' => (int) $server->swap, 'io' => (int) $server->io, 'cpu' => (int) $server->cpu, + 'threads' => $server->threads, 'disk' => (int) $server->disk, 'image' => $server->image, ], diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index 9cc1535a..b7b6fdb2 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -242,6 +242,7 @@ class ServerCreationService 'disk' => Arr::get($data, 'disk'), 'io' => Arr::get($data, 'io'), 'cpu' => Arr::get($data, 'cpu'), + 'threads' => Arr::get($data, 'threads'), 'oom_disabled' => Arr::get($data, 'oom_disabled', true), 'allocation_id' => Arr::get($data, 'allocation_id'), 'nest_id' => Arr::get($data, 'nest_id'), diff --git a/resources/views/admin/servers/new.blade.php b/resources/views/admin/servers/new.blade.php index f2efc2ce..6edf9f72 100644 --- a/resources/views/admin/servers/new.blade.php +++ b/resources/views/admin/servers/new.blade.php @@ -160,6 +160,13 @@ % +
Each physical core on the system is considered to be 100%
. Setting this value to 0
will allow a server to use CPU time without restrictions.
{{ $server->cpu }}%
{{ $server->threads }}
{{ $server->allocation->ip }}:{{ $server->allocation->port }}