Closed dandago closed 6 years ago
Seeing the relevant docs, perhaps I am just missing the concurrent garbage collection setting. I'll test this soon.
Are you using the old .csproj format by chance? It requires an app.config file to achieve the same. See #4440.
No, I was using a .NET Core project. I'll check if the concurrent garbage collection setting fixes this.
OK, I am still getting the warnings. I am following the docs to the letter, so I have this in my .NET Core csproj:
<PropertyGroup>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>
Perhaps Orleans is looking specifically for the old App.config settings? I get that impression from the warning - its instructions are App.config-specific:
I just retested locally, and I have no issue:
info: Orleans.Runtime.Silo[100404]
Silo starting with GC settings: ServerGC=True GCLatencyMode=Interactive
Did you try to rebuild?
@benjaminpetit I can confirm the issue happens to me as well in a brand new project.
There's a second repro in my last article (different project). That includes code and a screenshot showing the problem.
I will try your project @dandago
@dandago I tried your sample, it didn't have the GarbageCollection settings in the csproj. But with them it works fine:
That's the wrong article :) Check the "Getting Organised" (i.e. the one I linked) one, not the "Getting Started".
I just rechecked, and tweaked the project to be exactly like yours (had to make a code change due to the LangVersion), and I still get the same issue:
Sorry for the wrong solution.
But taking the solution from "Orleans2GettingOrganised", it works out of the box:
Could you try to delete manually the output folder and then rebuild and run?
@dandago @galvesribeiro check that the {YourDllName}.runtimeconfig.json looks like this:
{
"runtimeOptions": {
"tfm": "netcoreapp2.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.0.0"
},
"configProperties": {
"System.GC.Concurrent": true,
"System.GC.Server": true
}
}
}
The GC settings in that JSON file were missing. After deleting the bin and obj folders and rebuilding, they were there, and Orleans recognised the GC settings, so problem solved.
It would be useful to understand how this file gets generated and why the settings would be missing despite being in the csproj.
I would assume this is a tooling issue, but maybe Orleans codegen is playing a role here?
Other though: are you using the latest VS version?
Ok cool. I can confirm that deleting bin/ and obj/ sorted the issue. Thanks!
I am on VS 15.6.5. Latest seems to be 15.6.6. Just one version behind.
Almost certain this has nothing to do with Orleans codegen
If anybody is still having this problem in 2020 using just dotnet
to build the .net core code, here's what did the trick for me:
*.runtimeconfig.json
file. I only got this:{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}
I added those settings manually, ran the code without recompiling, and the warning disappeared, so I did some googling and found out that:
GenerateRuntimeConfigurationFiles
setting in the csproj
file:<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
*.runtimesetting.json
file got generated correctly as so:{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
},
"configProperties": {
"System.GC.Concurrent": true,
"System.GC.Server": true
}
}
}
Hope somebody find this useful.
@sergeybykov @ReubenBond @PiotrJustyna I'm still having this problem
Even with
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>latest</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
...
</Project>
and
root@o-dev-backend-graph-79fc48765c-n5nbd:/app# cat Graph.runtimeconfig.json
{
"runtimeOptions": {
"tfm": "net5.0",
"includedFrameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "5.0.3"
}
],
"configProperties": {
"System.GC.Concurrent": true,
"System.GC.Server": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
}
}
}
I get
info: VU.Platform.Common.Logger[0]
TableRepository<ConfigurationClient>.GetTableAsync() took 00:00:05.0011133, success: False
info: VU.Platform.Common.Logger[0]
TableRepository<ConfigurationClient>.GetAsync(partitionKey) took 00:00:06.1000552, success: True
info: VU.Platform.Common.Logger[0]
TableRepository<Configuration>.GetTableAsync() took 00:00:00.0080152, success: False
info: VU.Platform.Common.Logger[0]
TableRepository<Configuration>.GetAsync(partitionKey,rowkey) took 00:00:00.0948862, success: True
[16:24:38 WRN] Note: Silo not running with ServerGC turned on - recommend checking app config : <configuration>-<runtime>-<gcServer enabled="true">
[16:24:38 WRN] Note: ServerGC only kicks in on multi-core systems (settings enabling ServerGC have no effect on single-core machines).
[16:24:40 WRN] No implementation of IHostEnvironmentStatistics was found. Load shedding will not work yet
Orleans version @ 3.4.1
@ReubenBond @sergeybykov the above runs in a k8s container.
I've found the solution... I needed to assign more cores to the pods 🤦🏻♂️
I am running Orleans in a .NET Core console app. The project is basically the same as #4417.
In order to turn on ServerGC, I follow this Stack Overflow answer and add the following in my
.csproj
file:Despite this, I still get the following warning: