pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.73k stars 1.71k forks source link

Java availableProcessors() method not showing the right number of CPU threads #3954

Closed magrigry closed 2 years ago

magrigry commented 2 years ago

Current Behavior

Java [availableProcessors()](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.html#availableProcessors()) does not return the right number of CPU threads available, even without any CPU pinning specified, or even with more than one CPU pinning specified.

This issue make spark Minecraft plugin to report the wrong number of CPU thread available, I am not sure if it could have some performance impact. See related issue here https://github.com/lucko/spark/issues/175

Expected Behavior

Java [availableProcessors()](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.html#availableProcessors()) method should return the right number of CPU threads available.

Steps to Reproduce

I have no idea about how to reproduce this, a different server with the same hardware and mostly the same set up show the correct number of CPU threads.

Panel Version

1.7.0

Wings Version

1.6.1

Games and/or Eggs Affected

Minecraft paper with install egg script skipped

Docker Image

ghcr.io/pterodactyl/yolks:java_16

Error Logs

https://ptero.co/zymaxocupi
Note : logs show "Invalid value 8-9-10-11" because I tried different things.

[2022-02-10 10:39:28] production.WARNING: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for xxx in /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210
Stack trace:
#0 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\Handler\CurlFactory::createRejection()
#1 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\Handler\CurlFactory::finishError()
#2 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(47): GuzzleHttp\Handler\CurlFactory::finish()
#3 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#5 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#6 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke()
#7 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#8 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Middleware.php(63): GuzzleHttp\RedirectMiddleware->__invoke()
#9 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#10 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Client.php(331): GuzzleHttp\HandlerStack->__invoke()
#11 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Client.php(168): GuzzleHttp\Client->transfer()
#12 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/Client.php(187): GuzzleHttp\Client->requestAsync()
#13 /var/www/pterodactyl/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request()
#14 /var/www/pterodactyl/app/Repositories/Wings/DaemonServerRepository.php(24): GuzzleHttp\Client->get()
#15 /var/www/pterodactyl/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php(41): Pterodactyl\Repositories\Wings\DaemonServerRepository->getDetails()
#16 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(385): Pterodactyl\Http\Controllers\Api\Client\Servers\ResourceUtilizationController->Pterodactyl\Http\Controllers\Api\Client\Servers\{closure}()
#17 /var/www/pterodactyl/app/Http/Controllers/Api/Client/Servers/ResourceUtilizationController.php(42): Illuminate\Cache\Repository->remember()
#18 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Pterodactyl\Http\Controllers\Api\Client\Servers\ResourceUtilizationController->__invoke()
#19 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#20 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\Routing\ControllerDispatcher->dispatch()
#21 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\Routing\Route->runController()
#22 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()
#23 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#24 /var/www/pterodactyl/app/Http/Middleware/Api/Client/Server/ResourceBelongsToServer.php(88): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#25 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\Client\Server\ResourceBelongsToServer->handle()
#26 /var/www/pterodactyl/app/Http/Middleware/Api/Client/Server/AuthenticateServerAccess.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess->handle()
#28 /var/www/pterodactyl/app/Http/Middleware/RequireTwoFactorAuthentication.php(64): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#29 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication->handle()
#30 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#31 /var/www/pterodactyl/app/Http/Middleware/VerifyCsrfToken.php(44): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#32 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\VerifyCsrfToken->handle()
#33 /var/www/pterodactyl/app/Http/Middleware/Api/AuthenticateIPAccess.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\AuthenticateIPAccess->handle()
#35 /var/www/pterodactyl/app/Http/Middleware/Api/AuthenticateKey.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#36 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\AuthenticateKey->handle()
#37 /var/www/pterodactyl/app/Http/Middleware/Api/ApiSubstituteBindings.php(75): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#38 /var/www/pterodactyl/app/Http/Middleware/Api/Client/SubstituteClientApiBindings.php(60): Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings->handle()
#39 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\Client\SubstituteClientApiBindings->handle()
#40 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(58): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#41 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle()
#42 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#43 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(103): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest()
#44 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(55): Illuminate\Routing\Middleware\ThrottleRequests->handleRequestUsingNamedLimiter()
#45 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\ThrottleRequests->handle()
#46 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#47 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
#48 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle()
#49 /var/www/pterodactyl/app/Http/Middleware/Api/IsValidJson.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#50 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\IsValidJson->handle()
#51 /var/www/pterodactyl/app/Http/Middleware/Api/HandleStatelessRequest.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#52 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Pterodactyl\Http\Middleware\Api\HandleStatelessRequest->handle()
#53 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#54 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then()
#55 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack()
#56 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute()
#57 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute()
#58 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch()
#59 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#60 /var/www/pterodactyl/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#61 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle()
#62 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#63 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#64 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#65 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#66 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#67 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#68 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#69 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#70 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#71 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#72 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#73 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#74 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#75 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then()
#76 /var/www/pterodactyl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#77 /var/www/pterodactyl/public/index.php(68): Illuminate\Foundation\Http\Kernel->handle()
#78 {main} {"request_id":null}

Is there an existing issue for this?

iamkubi commented 2 years ago

It should work if you set a CPU limit. When you set the CPU to unlimited it's just that - unlimited. Not limited to 24 threads because you have 24 threads, just unlimited.

magrigry commented 2 years ago

Working, thanks !