I wrote a site using .netCore and locally everything works perfect. But on server I can't stay logged in for a long time. It takes 30-60 sec to kick me out to login page and I need to log in again.
My hosting allows me to use up to 1 gb memory for a process. But I have this logs in Application_pool_exceeded_limits.log: 17:33:59 A worker process with process id of '253876' serving application pool 'u123456789.plsk.[hostingname].com(domain)(4.0)(pool)' has requested a recycle because it reached its virtual memory limit.
I decided to check if this problems occurs if I delete everything but login page. Anyway this problem occurs.
That is my web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<identity impersonate="true" />
<machineKey validationKey="AutoGenerate,IsolateApps"
decryptionKey="AutoGenerate,IsolateApps"
validation="HMACSHA256"
decryption="Auto" />
<sessionState regenerateExpiredSessionId="true"
timeout="60"
cookieName="MyCookie"
cookieless="UseCookies" />
</system.web>
<location path="." inheritInChildApplications="false">
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Account.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
CodePudding user response:
You can try to change the Virtual Memory Limit:
- Open IIS Manager.
- In the Connections panel, select Application Pools.
- In the Application Pools panel, select the application pool being used.
- In the Actions panel, click Advanced Settings...
- Scroll down to the Recycling section.
- Change the value of Virtual Memory Limit (KB) to 0.
- Click OK.
CodePudding user response:
I don't know if this is best practice, but I was able to resolve the problem by changing "System.GC.Server" to "false" in [appName].runtimeconfig.json
.