Score:0

Solution for Web app hang or stack due to high traffic

km flag
Haz

I have a web app deployed in IIS on Windows Server 2016. It uses a SQL Server 2016 database. Currently, it has heavy traffic. When it reaches its limit (don't know what the limit is) web app stack, the login page appears but does not login the user. So it can not connect to the SQL server.

When I restart IIS, the web app is running fine again. Now at present, I have to restart IIS every 10 minutes. I need to know the real reason for the hang. There is no way I can find out when it goes off. Below I have given some detail.

OS - Windows Server 2016
IIS - version 10.0
Web app development platform - ASP.NET MVC
Database - SQL Server 2016
Database Size - 3.07 GB, Log file size - 648 MB
Database indexing is fairly good
Server Resource Monitor shows TCP connection 500

If anybody has any solution, please share. Thanks

vidarlo avatar
ar flag
Start by checking log messages.
Score:0
cw flag

I was also going to suggest log files, as vidarlo has done in a comment above. The IIS log files, typically in %SystemDrive%\inetpub\logs\LogFiles will list the requests. Also check Event Viewer assuming you have full access to the server. Is the web app software one your organisation wrote or is it externally supplied? Have you watched memory and cpu usage on the server? Is the Sql Server on the same box or separate? If separate, watch network traffic to the SQL box to see if that changes when the webserver locks up. On another tack - perhaps the issue is c# async thread deadlock - easy to do (I've done it myself using aync in MVC).

Haz avatar
km flag
Haz
Event code: 3004 Event message: Post size exceeded allowed limits. Event time: 29-Dec-2022 1:19:39 PM Event time (UTC): 29-Dec-2022 7:19:39 AM Event ID: 73124deaa6fe49cc87c821e4e2f45d22 Event sequence: 30202 Event occurrence: 4 Event detail code: 0 Process information: Process ID: 1692 Process name: w3wp.exe Account name: IIS APPPOOL\OOSC Exception information: Exception type: HttpException Exception message: Maximum request length exceeded.
David Pierson avatar
cw flag
Does that event correspond with a hang? Have other hangs also corresponded with the same event type?
Score:0
mx flag

you need to use logs/investigation to narrow down the cause. Number of connections in the sql connection pool is limited, you should be able to connect to the sqlserver and see what is happening from that side. Turn Query Store on & review the output of that to see if the sqlserver is overwhelmed, but the app needs to degrade gracefully under load if queries are taking too long (tip - check timeout for your sql queries is not 0, ie indefinite wait & note there are multiple timeout options, see https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring?view=dotnet-plat-ext-7.0 and https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/timeout-expired-error Also, be sure it is the db server that is your bottleneck here & not the IIS side or the network infrastructure either side (to the client or to the db)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.