-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make ASP.NET application always running on linux? #2367
Comments
The very concept of "always running" or not is only applicable when your application is hosted by IIS. It has the ability to stop/unload applications after a period of inactivity, and load/start it again when request comes. When hosting it as a systemd service on Linux, there's no such thing. All services (unless they're socket-activated templates on per-connection basis, which it is not your case) are always running. Systemd starts the service process and monitors its status, but otherwise doesn't affect it in any way (unless it is explicitly told to with So, with your app stopping and restarting, I can imagine a few possible scenarios:
In any case, there should be traces in the service log. If the reason is system limits, those can be altered globally or set in service config for a specific service. |
We have a background job that is long running and cannot be idempotent. When redhat restarts our hangfire .net core app, we lose hours of progress.
We are using following configuration.
`
[Unit]
Description=ABC
[Service]
WorkingDirectory=/var/www/html/ABC
ExecStart=/usr/bin/dotnet /var/www/html/ABC/XYZ.DLL
Restart=always
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
`
The text was updated successfully, but these errors were encountered: