3 ms·
I'm a huge C# advocate but we actually went the other way. Regardless of the tooling etc. we still have to use Golang for mission critical stuff. This is mainly
by morrbo 8y ago
I'm a huge C# advocate but we actually went the other way. Regardless of the tooling etc. we still have to use Golang for mission critical stuff. This is mainly due to the cold start times you mentioned - mainly the "first request" problem C# has with web related requests.
I've been keeping up with the latest developments, and it seems that they're finally starting to address the problem with tiered compilation stuff, which is fantastic. However, for now, waiting for 5+ seconds for a simple controller method to fully complete on a first post - with no way of auto-warming up (without using major hacks) on startup is just not acceptable.
Again, I really love .net, and contribute a fair bit to Signalr (core) myself, but feel this would really need to be addressed in an easy-to-integrate manner before it can be an absolute top tier language. They're addressing the other elephant in the room and providing a single-execuatable runtime-agnostic deployment option soon as well...which is amazing!
Overall though, for a language, you can't beat C#/core in my opinion and would 100% recommend it.
- sebastienros 8y agoYou can usually cut the cold start performance in half by enabling Tiered Compilation. It's just one parameter in your project file, or via an environment variable. Disclaimer: I work on performance in the ASP.NET team.
- morrbo 8y agoSaid that in the post above :) however it doesnt seem to impact HTTP requests or requests to a signalr hub for the first time after boot. We've had tiered compilation enabled since it came out as an option, but the first requests are still dog slow
- ajryan 8y agoWhat are you disclaiming?
- morrbo 8y agoI should say (since i've got your attention) that i'm almost 100% sure that all of your customers would be more than willing to sacrifice a startup time for a well-coordinated callback when everything is warmed up, as a toggleable option of course. To explain this a bit better, i'd definitely be happy even waiting 10+ minutes for all of my controllers/hub methods to be instant response. I could then subscribe to an event when it is ready and let haproxy/nginx or whatever else know that the server is "good to go". This way, the server goes into the pool, and everyone is happy. I remember seeing that the Bing guys did something like this, but again it was majorly hacky. Thanks for all the great work you're doing on C#/.NET Core in general by the way.
- sebastienros 8y agoTiered Compilation is tweaked in a way that it provides a very good balance between startup time and throughput, which is what a majority of users would need. If you want to privilege throughput and don't care about startup time, then you should try COMPlus_ReadyToRun=0 as an environment variable. This will force to use non-crossgened code so the JIT can better optimize your code.
- dmarlow 8y agoHow about using native compilation?
- smashedtoatoms 8y agoYea, this project is mostly batch processing of things, so cold starts don’t matter. There is one api endpoint that we left in go for quick responses. I thought about doing a C# to js transpile, but have not had time to look into it. That being said, our cold starts are < 2 seconds with dotnet core 2.1, which isn’t great, but isn’t too bad.