ASP.Net has very high server time - asp.net

I have a 32-bit asp.net application running in IIS 7.5. I am having an issue with the pages.
Mentioned the issue below.
Open a page. Hit the database through some action in the page.
Open another page in another tab. Now, the second page doesn't respond till the first page responds. The second page has no database hits in page load. It's just plain HTML.
This happens with all the pages in the application. I am not sure if it is because of IIS or my application.

Do you have sessions enabled? If yes, all requests will be run serially. If you can, try to avoid using sessions or only enable it where you need it.

Related

Window.open is losing session

My team have a big problem with a developed website. We have a page where We need to open three or four tabs, We used window.open and everything worked fine in testing area. But, in production with a load balancer (sticky session configured) when window.open is executed, It creates a new session, We saw in the logs that the request is redirected to other server when window.open is executed.
I've seen other links in stackoverflow like IE8 losing session cookies in popup windows
But the problem is that It happens also in Firefox, any clue about this kind of problem?
BTW, Our app is a ASP .Net MVC 4.5 website.
Second part of your question is pointing to a problem on the client side.
But if I read your problem it looks like a problem on the server side.
I think that your session pool over the load balancer has a problem.
Maybe try a simple page that shows your sessionId on a page and run that in your server farm for testing. make shure that the problem is not in your app but at server level.
edit after questionar reply:
Is your cookie set domain wide?
what happens if you open more tabs manually?
Is it a browser domain cookie handler problem (then the manual tabs will not work)
Or is it a javascript handler problem. (then the manual tabs will work)

How ASP.NET Web Pages Threading / Multi Tasking Works for Single user?

This Might be a very basic Questing. (URGENT)
I have a Web application with multiple pages.
When a user is Logged in using Visual Studio(Development) / IIS (Production )
If the user have opened a Page 1 from home page which is long running process (Lets say few minutes)
Can the same user open Page 2 from home page while Page 1 is still running.
There is no connection between Page1 and Page 2.
Remember I am talking about the same user in the same machine.
Does ASP.NET takes care of this MultiThreading by default for above situation?
Or I Should create Separate Thread for each page?
I my case I not able to open the second page still the first page is Finished.
Please shed me some light.
Regards
The answer is yes, if a user is opening Page 1 (which may take a long time to render), other users, or even the same user, can still open other pages in the application at the same time* (including Page 1 again).
(*) Unless database locking or some other explicit mechanism prevents this, however you have to try fairly hard to get this to happen

Session transfer between asp.net and asp works in soome cases and in some cases not

I transfer session from asp.net to classic asp.
I use MSSQL DB for it.
I have
SomeWebPage.aspx - this page is asp.net which save sesion, after it, it call by redirect
SessionTransfer.aspx -this page save sessions to DB and call by redirect
SessionTransfer.asp - this page load session from DB and cal by redirect
SomeWebPage.asp - this page doesn't need now about other pages, it just use session.
Problem is, that it works only if SomeWebPage.aspx, SessionTransfer.aspx, SessionTransfer.asp and SomeWebPage.asp are in same folder, or in same "web pages" folder on iis.
How can i do it if SomeWebPage.asp will be in other web folder. On same IIS server, but it will be specific web?
I use IIS 5.1 for developing and finished program will run on IIS 6.0.
Problem was that it was different applications.
SessionTransfer.asp must be it same application like SomeWebPage.asp (it wasn't)
and
SessionTransfer.aspx must be it same application (pool) like SomeWebPage.aspx (it was)
It ws teddy-bear problem. When we start discus about this, i realized where is problem :-D
thanks amit_g

ASP.NET web site: Delay in page load

I have a web application developed in ASP.NET 2.0, deployed in a data center. The application is a media portal with CMS.
The application is hosted in Windows Server 2008 and the database is SQL Server 2005 in Windows 2003 Server.
I have home page with numerous links to sub pages or articles. When I click on any of the links in home page, it will load the content of the page in article.aspx. My problem is with the delay of rendering the article.aspx page.
The status bar shows the progress of loading the new page. But the actual page render happens after few more seconds (20-30) after showing progress of page loads completes ie. after completing the progress bar in the status bar of my browser, the browser retains to show the current page and its showing a "Done" message in the left side if status bar. After 20- 30 seconds then the browser renders the desired page (article.aspx)
The speed was good initially and the performance came down almost after an year of hosting. What is happening here? Do I need to check anything with IIS or DB?
You have to check either it is database or code.
I agree with robert and suspect this is due to database. you can use sql profiler to find out what is going wrong.
If database is not the culprit then You have to use some kind of profiling tools to check what is going wrong.
As frogbot suggested asp.net trace is one way.
you can also use FireBug,YSLOW,Pagespeed as firfox plugin to help you.
RedGate's Ant Profiler is very good but it is not free.
Do you have any Ajax or other javascript code that render content in client-side runtime? This will happen hafter the page is loaded.
Sounds like your page loads are going to the database for data, maybe your populating a grid and some drop downs for instance. As the data has increased in the DB over time the queries have grown progressively longer to run and your page load has slowed as a result.
Perhaps the host now hosts more sites and more databases on the same servers which has also impacted the site.
Possibly just 1 bad piece of SQL taking 20-30 seconds to complete.
Network issues.
You need to enable tracing to see what's wrong. Check the articles here. If you find it is the database issue use SQL Server Profiler.

ASP.NET gone FUBAR on a production machine

Today we tried to put an ASP.NET application I helped to develop on yet another production machine. But this time we got a very weird error.
First of all, from all the ASP.NET pages, only Login.aspx was working. The rest just show a blank screen when they should have redirected to Login.aspx. The HTTP response is 200, but no content.
Even worse - when I try to enter the address of some inexistent ASPX page, I also get HTTP 200! Or, when I enter gibberish in some existing ASPX page code (which should have been accessible without login) I also get HTTP 200.
If I enter the name of some inexistent resource (like asdasd.jpg), I get the expected 404.
The redirect to login page is written manually in Global.asax. That's because the application has to use some alternate methods of authentication as well, so I can't just use Forms Authentication. I would suspect that Global.asax is failing, if not for the working Login page.
Noteworthy facts are also that this machine is both a Domain Controller and has SharePoint installed on it. Although the website in question is listed in SharePoint's exception list.
I would check the following:
Is the application within a virtual application or its own site and not just a virtual directory?
Does the application have it's own App Pool? If it does not then is the app pool shared by apps in a different .net version.
Is the .net version of the application the correct one? 1.1 or 2.0?
Do the files in the file system have the correct permissions to be accessed via IIS?
Have you performed an IIS Reset?
Create a stand alone test.aspx page within your folder that just displays the date/time and check it works.
Make this single test.aspx page perform an exception (eg. divide by zero) and see what the outcome is.
More information required.
What Op Sys?
What mode IIS running under?
What version of .Net?
What version of SharePoint?
(Why are you using your DC as a web host?)
Does it work on the other production machines you've deployed to?
If so what is different between this machine and the working ones?
Did you deploy the same way?
Are you sure your hitting the right machine?
Are you sure your hitting the right web site?
What ISAPI components are installed globally and for the web site?
Is .aspx mapped to the ASP.Net ISAPI filter?
Do you have any HTTP Modules or HTTP Handlers configured?
Can you change the global aspx to write out some messages so you can be sure the piece of code you interested in is reaching?
Anything coming up on the IIS log or the event logs?
Addition:
What version of .Net?
By the sounds of it the .jpg request is being dealt with by IIS directly which is why you get the 404, but the .aspx request is being dealt with by something else which except for you login page, is always returning 200.
Assuming .aspx is wired correctly to .Net the the order of processing is based on ISAPI filters (high to low then global before site), then the ASP.Net ISAPI Extension (sorry I said this was a filter earlier but it's actually an extension). Then we get into the ASP.Net pipeline based on your .Net configs, and calls the HTTP Application (which includes your global.asax code), any HTTP Modules followed finally by a HTTP Handler. Your ASP.Net web forms are just fancy HTTP Handlers.
However, the request can be responded to and terminated from any point.
Since your code works on other machines though, I'm tempted to point a finger at SharePoint if it isn't installed on the working machines. Is this SharePoint 2007? That is also an ASP.Net application (I don't think 2003 was).

Resources