I am stuck on one issue and I need your help badly.
I have an ASP site configured to run on IIS 8. Now, due to server load, IIS is not responding after a while and i need to reset IIS to start the site again.
Basically, I am from an ASP.Net environment. So here in ASP, I am having a problem applying the proper configuration. One thing I would like to accomplish here is to increase the number of worker process for the site in IIS, but I am afraid that if I do that then there may be a session issue. As you know, ASP sites do not have sessionstates and its default will be of InProc.
However, I read on MSDN about the keepSessionIdSecure property. This indicates that the session is stored on the Client in cookies. Does this mean that i can safely increase the number of worker process?
Any help or suggestions would be much appreciated. This is the production server, and I would not like to take any chances here.
Related
I m hosting asp.net mvc website and it really slow at the start. it take 40s to 1 minute. how to fix this.
i have tried bundling and minication. Debug mode=false in webconfig
my wesite is www.mmfujistore.com
My first thought on seeing this is that your hosting provider shuts down your server when it is idle for more than a few seconds in order to make room for other customers. That it takes so long to start up is because your shared application is literally booting up if you make a request after the site is down for a while.
If it works fine locally, I am going to bet you are best off finding a better hosting provider. If you update to use .net core you can use any linux host out there. I'm going to bet this isn't a .net issue.
Edit: I agree. I used to work there and I can confirm that they do this to manage the load by limiting the application pool memory considerably for each client. Considering the number of customers on the shared server it gets really difficult to manage, it really does not cause issues for most apps but if your application is memory hungry, they won't do anything to fix it permanently. The best they can do is free your app memory pool temporarily but it will get full once again. Your best option would be to move to another provider if this persists.
We have a web application that runs on 6 web servers with HAProxy as the load balancer. We use web deploy to sync our IIS and application across all web servers. Starting January some of customers starting reporting application slow downs. After a lot of work we found that request coming to IIS at random times get stuck in BeingRequest state of IIS Web Core. I am attaching a screenshot from one of my server. Any insight into the issue will be really appreciated.
Thanks,
Fahad
I have a similar issue but my requests are stuck in a different part of IIS. If anyone has any input there you may also find it useful - Debugging requests which are 'stuck' in an IIS worker process
In the screenshot you give your oldest request is 16s old - do they stay in forever or are they just very slow to process? If they don't process is the oldest request in the queue always exactly the same URL and if so can you trigger the issue with that URL?
If they do eventually process (or even if they don't) a good first step for you would be to run Failed Request Tracing/Logging - you can configure it directly in inetmgr at site level. Looking at the compact output will give you an overview of if your requests are being sent on loops around IIS or if there is anything triggering that you wouldn't expect in the life of the request.
If they do eventually process also look into utilisation exhaustion - maybe IIS is just crawling as it's struggling for CPU/RAM/IO - check out the usual suspects.
I can't debug the problem but apparently some coding problems cause it to break down and get reset IIS processes. I want to modify it as a way it will work with multiple processes so 1 process fail won't cause web site to hang up.
Click application pool and then click advanced settings at the right
Change Maximum Worker Processes to the number you want to multiply.
But at this scenario you also have to change your session state. You can use sql server or stateserver which i suggest.
You have to configure your web config like this
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="60"/>
You would need to segregate the applications into separate application pools (this can be done through IIS Manager). An IIS application pool is managed by a worker process, so many applications running in the same pool run the risk of collapsing if one of the applications causes unexpected behaviour.
That aside, you really need to understand why the application itself is causing problems. Have you tried running the application through Visual Studio and Casini (or IIS Express)?
I have a web application that's consuming a WCF service. Both are slow on warmup after IIS reset or app pool recycle. So, as a possiible solution I installed Application Warm-Up for IIS 7.5 and set it up for both web site and wcf service.
My concern is, it doesn't seem to make any difference - first time I hit the site it still takes long time to bring it up. I checked event logs, there are no errors. So I'm wondering if anything special needs to be done for that module to work.
In IIS manager, when you go into the site, then into Application Warm-Up, the right-hand side has an "Actions" pane. I think you need the following two things:
Click Add Request and add at least one URL, e.g. /YourService.svc
Click Settings, and check "Start Application Pool 'your pool' when service started"
Do you have both of these? If you don't have the second setting checked, then I think the warmup won't happen until a user hits the site (which probably defeats the purpose of the warmup module in your case).
There is a new module from Microsoft that is part of IIS 8.0 that supercedes the previous warm-up module. This Application Initialization Module for IIS 7.5 is available a separate download.
The module will create a warm-up phase where you can specify a number of requests that must complete before the server starts accepting requests. Most importantly it will provide overlapping processes so that the user will not be served by the newly started process before it is ready.
I have answered a similar question with more details at How to warm up an ASP.NET MVC application on IIS 7.5?.
After you have fixed possible software/code optimizations allow me to suggest that each and evey code needs processing via hardware cpu. And our server skyrocketed in performance when we went to a multicore cpu and installed more GIGS of ram and connected UTP-6 cable insetad of standard UTP 5e cable onto the server... That doesnt fix your problem but if you are obsessed with speed as much as us, then you will be interested in the various dimensions that bottleneck speed.
I haven't found a definitive list out there, but hopefully someone's got one going or we can come up with one ourselves. What causes disruptions for .NET applications, or general service disruption, running on IIS? For instance, web.config changes will cause a recompilation in JIT (while just deploying a single page doesn't affect the whole app), and iisresets halt everything (natch, but you see where I'm going). How about things like creating a new virtual directory under a current web app?
It's helpful to know all the cases so you know if you can affect a change to a server without causing issues with the whole thing.
EDIT: I had IIS 6 in mind when I asked, but of course a list of anything different in other versions would be helpful as well to people.
It depends on what exactly you are talking about with disruptions. IISReset can cause a Service Unavailable message to display for a short time as IIS is shutdown and re-started.
Changes to the web.config, or adding a .dll file to the bin directory of an application causes a recycle of the application domain but that is not a disruption exactly, more of a "delay" in responding, the user will NOT see an error just a delayed response from the server. You can also get that from changing any files in App_Code or .vb files on non WAP developed sites.
You can also get IIS Worker Process Shutdowns due to inactivity, default setting is 20 minutes. Again this is a delay, not a lack of service.