The loop span through its body regardless of whether there was anything to do -- ~10% of a desktop core for an empty shard, ~70% of a small VPS core, and a process that never idles is exactly what burstable vCPU plans throttle. The loop now blocks in NetState.WaitForCompletion whenever every queue it drains is empty, waking on the next timer tick or the moment work arrives. Receive completions, new connections, and cross-thread LoopContext.Post (via IORingGroup 1.0.10's sticky Wake) are all in the wait set, so sleeping adds no latency to any of them; only timer-driven logic sees wheel lag, bounded by server.eventLoopIdleWaitMs (default 2ms, 0 = never sleep). Measured on a real world of 190k items / 33k mobiles: 10.4% of a core to 0.8-1.0%, with peak tick lag unchanged. Spin mode independently gained 7x the iterations per core from the ring's AcceptEx rework. Sleeping also gives the GC natural pause points, which the old spin loop denied it -- memory no longer climbs until a save forces a collection. A sleep is bounded by the next wheel turn, so a correctly honoured sleep can never miss a deadline; the only way sleeping harms the wheel is the host returning the wait late. That overshoot is measured on every sleep, and an escalating backoff (server.lateWakeThreshold) suspends sleeping when it persists -- server work like saves or heavy commands cannot trip it by construction. Hosts without high-resolution waits are detected once at startup and spin instead. The admin gump shows the verdict instead of the now-meaningless CPS figure, which is removed. Time accounting for diagnosis is compiled out of normal builds: build with -p:EventLoopProfiling=true to enable EventLoopProfiler (per-phase wall time, sleep overshoot, GC pauses, stolen-time residual, ~15min ring buffer) and the [LoopStats command with CSV dump. See dev-docs/debugging-event-loop.md for the diagnosis funnel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
83 lines
4.9 KiB
XML
83 lines
4.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project>
|
|
<PropertyGroup>
|
|
<Authors>Kamron Batman</Authors>
|
|
<Company>ModernUO</Company>
|
|
<Copyright>2019-2026</Copyright>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<LangVersion>14</LangVersion>
|
|
<PublicRelease>true</PublicRelease>
|
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
<NoWarn>NU1603</NoWarn>
|
|
<RuntimeIdentifiers>win-x64;win-arm64;osx-x64;osx-arm64;linux-x64;linux-arm64</RuntimeIdentifiers>
|
|
<Configurations>Debug;Release;Analyze</Configurations>
|
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
<WarningsAsErrors />
|
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
<SkipLocalsInitAttribute>false</SkipLocalsInitAttribute>
|
|
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
|
|
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
|
|
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
|
|
<IsX64 Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)' == 'X64'">true</IsX64>
|
|
<IsArm64 Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)' == 'ARM64'">true</IsArm64>
|
|
<DefineConstants Condition="'$(IsWindows)'=='true'">WINDOWS</DefineConstants>
|
|
<DefineConstants Condition="'$(IsOSX)'=='true'">OSX</DefineConstants>
|
|
<DefineConstants Condition="'$(IsLinux)'=='true'">LINUX</DefineConstants>
|
|
<DefineConstants Condition="'$(IsOSX)'=='true' OR '$(IsLinux)'=='true'">UNIX</DefineConstants>
|
|
<DefineConstants Condition="'$(IsX64)'=='true'">CPU_X64</DefineConstants>
|
|
<DefineConstants Condition="'$(IsArm64)'=='true'">CPU_ARM64</DefineConstants>
|
|
<DefineConstants>MUO</DefineConstants>
|
|
<GitVersionBaseDirectory>$(SolutionDir)</GitVersionBaseDirectory>
|
|
<PredefinedCulturesOnly>false</PredefinedCulturesOnly>
|
|
</PropertyGroup>
|
|
<PropertyGroup>
|
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(RuntimeIdentifier)'==''">
|
|
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
|
<SelfContained>false</SelfContained>
|
|
<InvariantGlobalization>false</InvariantGlobalization>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(IsWindows)'=='true' AND '$(IsX64)'=='true' AND '$(RuntimeIdentifier)'==''">
|
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(IsWindows)'=='true' AND '$(IsArm64)'=='true' AND '$(RuntimeIdentifier)'==''">
|
|
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(IsOSX)'=='true' AND '$(IsX64)'=='true' AND '$(RuntimeIdentifier)'==''">
|
|
<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(IsOSX)'=='true' AND '$(isArm64)'=='true' AND '$(RuntimeIdentifier)'==''">
|
|
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
|
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
|
<Optimize>false</Optimize>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
|
<Optimize>true</Optimize>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(Configuration)'=='Analyze'">
|
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
|
<CodeAnalysisRuleSet>..\..\Rules.ruleset</CodeAnalysisRuleSet>
|
|
<AnalysisLevel>latest</AnalysisLevel>
|
|
</PropertyGroup>
|
|
<!-- Event-loop time accounting, compiled out unless requested:
|
|
dotnet build -p:EventLoopProfiling=true
|
|
See dev-docs/debugging-event-loop.md. Placed last so it appends to whatever the
|
|
configuration groups above set DefineConstants to. -->
|
|
<PropertyGroup Condition="'$(EventLoopProfiling)'=='true'">
|
|
<DefineConstants>$(DefineConstants);EVENT_LOOP_PROFILING</DefineConstants>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<PackageReference Include="Serilog" Version="4.3.1" />
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
|
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
|
|
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
|
|
<Version>3.10.91</Version>
|
|
<PrivateAssets>all</PrivateAssets>
|
|
</PackageReference>
|
|
<AdditionalFiles Include="..\..\Rules.ruleset" />
|
|
</ItemGroup>
|
|
</Project>
|