IIS Stuck in SendResponse state - asp-classic

I have a classic VB6 ASP application compiled into dll's and executed through COM. The web site pulls from a SQLServer database.
One particular function builds a page by getting data rows, and then for each data row queries the database again to build rows in a sub table.
The problem is that if this page is large, and if the request for the page comes from a remote machine, then the IIS server gets stuck in the SendResponse state and never sends the page. If I call that same page using the same dataset, but call it from a browser running on the server itself, the page is quickly built and rendered. If I modify the sqlquery so that fewer rows are returned and the page is smaller, all clients can quickly load and render
I think I've confirmed that even when the page hangs the sql queries complete quickly and the COM objects have completed building the page.
I have a test server where I can test exact copies of the application but I haven't been able to find a setting in IIS or the apps web.config files that will duplicate the issue.
Is there something at the OS network layer I should be checking?

Related

ASP.NET Website - When does session get reset

For an ASP.NET Website where i am making updates. What would cause user sessions to reset?
From my understanding if i make any changes to files in the app_code folder or the global.asax file it will reset everyone's session but if i made a change to .cs file (in the top directory) it wont reset everyone's session?
Would it reset the session of anyone that was on that page that i updated?
Can someone help me with my understanding, thank you.
Assuming memory-based session (as opposed to sql server based).
Well, the app pool restart will blow out session.
(so, in some cases even un-handled errors will blow out session).
Modify web config?
that will case app pool to restart (and blow out session).
Update any folder outside of app_data. Again, app pool re-start (and blows out session).
change content of bin folder - again app pool re-starts, (and blows out session).
Update code behind (.cs, or vb pages (code behind)). - again, app pool re-starts, (and blows out session). (so anything that will cause a re-compile of code).
There are probably a good many more - the above is a basic list.
You can thus consider adopting sql session based, and that will thus be far more robust, and I even re-started IIS services, and users if not doing anything just looking at their web page while logged on? They were able to continue working even after a full re-start of IIS services.
On the other hand, I now always use a asp.net web site "applcation". Thus no souce code is placed on the web server, and my compile is done with visual studio before deploying. The only big issue is that if you change to a application deployment model, the even just changing one line of code behind will force/require a full re-publish of the web site.
It looks like you are using a web site, and thus source code (code behind) is placed on the web server. Thus, IIS has the job of re-compiling such code, and thus any code change will as a general rule cause a app_pool re-start, and thus loss of session.
As noted, if you change from in-memory session to SQL server based (turn that feature on), then most if not all of your session issues will go away. Even if you not using "application deployment" and have/use code behind on the site for IIS to re-compile? Then using sql server-based session management should fix all of your session() woes.

IIS only processing one request at a time

We have an asp.net web application that works fine in our environment. One of our partners tries to the exact same code in their environment and can only process one request at a time. For example, there is only page that calls a long running stored procedure (5 minutes). If you call that page and the try to open a new page, the new page won't serve until after the first page has completed. We can see the request back up by looking at the worker processes for their application pool. They are running IIS 8.5 on a windows 2012 server. They're also running SQL Server 2016.
The database connection is structured the same as as in our environment. The stored procedure is not wrapped in a transaction. Any ideas what might be causing this behavior?
IIS also can work in the Debug mode, when it is enabled, Asp is limited to processing one request at a time in a single-threaded manner.
Open “InetMgr” or IIS manager, double click ASP under the IIS section of the website. Check the below settings in Asp section.
See the below discussion for more information.
IIS7 - only serves up one page at a time. It's a making me crAzY!

Creating a standalone windows application from an ASP.NET website

I am developing an ASP.NET website. The users can open up the web page and work with data when they are online. But I want to make them able to work when they are offline and submit their changes later when they are online again. The offline application must be very simple to run and I don't want to develop a separate windows application for this purpose.
So I want to build an executable that when starts, first starts up a local IIS and then opens the startup page of my website (which is locally available) in the user's browser.
And of course it would be great if this executable can be installed on the user's system along with my website files, IIS and SQL Server Express all in one package.
OK I re-read your question and see that you will have local IIS and local Database installed on all client systems.
So then the solution is very simple.
The Applicaiton (main form)
Create a windows forms application.
Put a WebBrowser control and a StatusStrip control on the form.
Add two string resources named say LocalStartUrl and OnlineStartUrl, which holds the addresses of your local and online website home/startup pages.
On Form_Load, check for online internet connectivity and accordingly launch either LocalStartUrl or OnlineStartUrl in the webbrowser control. You can show messagebox and use the StatusBar to inform the user of the same.
The sync module:
The database sync module runs in the timer/separate thread and synchronizes your local database with online database in the background. It sends any unsaved changes to the server and downloads any missing data from the server to local database. You would need to control the speed of this module so that user doesn't face difficulty browsing other websites or using the application smoothly etc. It should be slow and steady and send/request only small chunks of data at a time.
When in offline mode, it just periodically checks for online connectivity at regular intervals. As soon as an internet connectivity can be found, the user is informed. If they permit, it switches over to online mode. Otherwise the user continues to work offline until the application is closed and launched again.
In online mode, the sync module syncs data to & from the online database. This doesn't affect the user because they are not connected to this database. Instead they are connected to the online website and database.
It will take efforts to streamline this approach, but ultimately it is achievable easily.
This won't be just a single task. It would be a series of task working together in sync.
Your windows application does the following:
Write the offline changes to a disk file/database etc.
Periodically check the online availability of your website/ftp site.
Whenever the website is found to be available, and there are some cached changes, submit the file to the website/ftp site.
Your server does the following:
Whenever a file is recieved, check for its validity and integrity. If found correct, put it in a specific folder.
A service on your server watches the folder and as soon as any file is found there, processes the file(s)
The service moves the file to another folder (backup) after processing.

Asp.net web application crashes when retrieve data from an oracle DB

I have an asp.net website on a windows server 2003. The application connects to an oracle 10g R2 Database and the data layer is generated by subsonic.
The database and the application are on separate servers each.
On development machine the application runs normally. But On production server, there is a server error that occurs in pages that communicates with the database
The problem is that the error does not happen all the time, it is on and off and i can not debug it since it does not happen locally. if i refresh the page. everything works fine. but with another refresh the error might show again.
And we started getting oracle client errors such as:
- Transaction has completed; it is no longer usable
- Invalid operation. The connection is closed
- Unable to load DLL 'oramts.dll'
- Attempted to read or write protected memory at
System.Data.Common.UnsafeNativeMethods.OraMTSJoinTxn
I think the error is due to overload or performance.
Does anyone have an idea about the above problem?
We managed to solve this problem, by moving the application and the database, each to another machine.
I most probably think, it was a server performance issue, or network disrupt between the application and the database (each was on a separate server machine).
We eliminated the code error case, since if it was so, the application wouldn't run at anytime but the pages were loading every now and then, or if you keep hitting f5.
And we kept getting oracle client errors.

Multiple ASP pages blocking each other

I have some ASP pages calling SQL scripts. Each ASP page takes about 20 seconds to 'run' the complete sequence of calls to the database which involves some VBScript in the ASP pages calling multiple SQL calls.
If I put the same .asp page address in two tabs of a browser, hit refresh on both pages, the second page will wait until the first page is complete before starting. On the server itself, I can run other SQL queries without affecting the web pages or being blocked. In fact, I can see this using another CPU core.
So, I think it is an IIS issue, not SQL
Running XP Pro 64, IIS6, ASP.NET 2, MS SQL Server 2008.
Tried various setting on IIS and playing with processes / web garden.
Any help much appreciated!

Resources