M
M
maxcad2021-08-16 14:40:07
.NET
maxcad, 2021-08-16 14:40:07

C# .NET on Linux. I want to try. Who will answer?

The situation is the following. I provide support for several sites. To automate this work in various ways, I wrote a bunch of bash and php scripts. These are backups of files and site databases, updating GeoIP databases, analyzing various logs, analyzing all sorts of behavioral factors and recognizing attacks.
I started a long time ago and now I have a hodgepodge of 100,500 scripts in which I myself can’t figure it out.

And so I decided to look towards technologies from Microsoft. There they have VisualStudio can make applications for Linux. The tool is very handy. .NET components provide a bunch of delicious goodies. You can create a single project for everything and everything in a single binary. Tasks are divided into separate threads. There is beauty all around.

Here only there is a question. But will not all this beauty pull on all the resources of the server?
Does anyone know how .NET behaves in terms of resource consumption?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Developer, 2021-08-16
@samodum

It all depends on how crooked your hands are.
You can make slow shit, or you can write a great fast application that consumes almost no resources

S
Sergey Karbivnichy, 2021-08-16
@hottabxp

I want to try.
Try who does not.
Who will answer?
I'll try. Try Python better. It's much simpler (the syntax is much simpler than in bash and php, since Python was designed from the ground up to be easy to read code). In addition, there are a huge number of libraries that solve almost any task! Many mathematicians, scientists, engineers, etc. (whose profession is not directly related to programming) choose Python, because it is one of the simplest. In addition, almost any task can be implemented on it.

I
Ilya, 2021-08-16
@sarapinit

Does anyone know how .NET behaves in terms of resource consumption?

Like any language with a garbage collector, it is forced to interrupt execution for garbage collection. Therefore, you need to be careful with allocations in "hot" execution paths. Tips for optimizing garbage collection have long been described, even a whole book has been written. That's just not very good with profilers for Linux.
There is also a nuance with the file size, which is quite large even in the Release build. This is because the libraries are placed next to the executable files in full size, nothing is cut off. Now work is underway to compile into one file and reduce the size of this file, but there are nuances. For example, for solutions with dynamic loading of assemblies or using reflection (in some cases), pruning will break everything. That is, you need to be prepared for the fact that the Release daddy will weigh 100-200MB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question