CPU cap for IIS application pool [closed] - iis-7.5

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have been attempting to implement a CPU cap for a specific IIS application pool running on a web server (Win2K8 R2). I have tried using Windows System Resource Manager using several different process matching criteria, but the process never actually gets capped.
First Attempt
The first process matching criteria I got from here. The actual matching criteria I entered was #w3wp.exe.*MyAppPoolName
Then I created my resource allocation policy, and pointed it at the above process matching criteria. I capped the CPU at 25%, enabled the policy, started my app pool, and kicked off the application running in the pool. The app pool's CPU immediately spiked over the 25% limit and stayed there fairly consistently.
Second Attempt
The next matching criteria I tried came from here. The actual matching criteria I entered was #.*w3wp\.exe.*MyAppPoolName.*
I updated my allocation policy to point to the new matching criteria, and started everything back up. Again, immediately spiked over the limit.
Third Attempt
On my third and final attempt, I used the built-in controls in the Add Rule dialog in WSRM. I selected IIS App-Pool from the drop-down, clicked the Select... button, then chose my app pool. The matching criteria it generated was C:\Windows\system32\inetsrv\w3wp.exe * -ap "MyAppPoolName"
Again, I updated my allocation policy, and started everything up. Again, immediately spiked over the limit.
Has anyone else ever actually been successful at implementing one of these allocation policies? They seem very straightforward to set up, but have been nothing but a pain to actually get to work!

Or update to Windows 2012 with IIS 8 which supports this out of the box. IIS 7+ does support CPU monitoring but only offers to kill the application pool if it goes over the limit.

Related

NodeJS and ExpressJS app memory keeps increasing as the load increases [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have a NodeJS and ExpressJS app running with Nginx on it's front. The app is pretty big and we have around a millions users per day. Memory of the app keeps growing as the load increases. And, at a point requests starts getting dropped as there is no more memory left on the server.
My initial guess was some module / snippet is giving memory leaks in the code, explore memory heaps and profiled the app. but, still not found the culprit. Any suggestions??
You can use spawn few more machines with higher RAM. Then use HAProxy and sticky sessions and balance the load accordingly.
Also you can use cluster mode and pm2 tools.

Migrating cloudbees application to amazon beanstalk

Cloudbees is shuting down its hosting services, so I am looking for migrate my java web app to Amazon ElasticBeanstalk.
Question 1: Is it the right choice?
Question 2: In cloudbees, all I did was chose the app cells (256m) and set auto scaling true. And never worried about anything else. Now while configuring the same in beanstalk, I see a new thing called instance type t1 , t2 , small etc in addition to software configuration tab where i set the initial jvm to 256m
So what should I select the instance type to?
Question 3: In cloudbees, the price was dependent on app-cell which means the jvm memory I chose, but it seems in beanstalk, i can set memory to even higher and price is charged on the basic of instance type. Is it?
Question 4: So saying, i just need to replicate the same setting i.e init jvm with 256m and set autoscale true, what should be my corresponsing setting in beanstalk?
Question 1
This is an opinion and you will likely get differing answers.
Question 2
Instance types are all based off of EC2's list of instance types and each instance's price is determined by memory and CPU. The pricing is then rated per hour. Do take a note of the Free Tier on that page though since you are new.
Question 3
Yes, it is based on the following (unless you are in the Free Tier):
For example, if you had two t2.micro's running, one for 40 hours and one for 10, that'd be:
Question 4
You'd want any instance you wish running as a Load Balanced environment with Auto Scaling turned on.

In the context of Azure Websites, is a 2 "small" standard instance setup better than 1 "medium" server instance setup? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I read a lot about the importance of having at least 2 websites instances in Azure, one reason being that MS will only honour it SLA, if there is, due to being able to patch one server while having the other available.
However we current have strict budgets, and currently have 1 medium server with the bigger RAM. I have always believed that bigger server with more RAM is always better. Also 2 cores on the same machine may be quicker as well.
We have noticed the odd recycle, but it is too early to say whether this is due to MS patching.
Assume my application is a MVC3/EF5/SQL Azure app with 10 user concurrency, and processing is straigtforward, ie simple DB queries etc.
In the context of Windows Azure, assuming a budget limit, would 1 medium(2 x 1.6Ghz cores and 3.5 GB RAM) server be better than 2 small(1 x 1.6GHz Core and 1.75GB RAM) web server instances.
Thanks.
EDIT 1
I noticed this question has attracted 2 votes for being opinion based. The question is designed to attract reports from real experience in this area, which of course informs opinion. This is hugely valuable for my work, as also others.
EDIT 2
Interesting about SLA. I was concerned about when MS does an update, then one instance would disappear while this occurred. So what would happen in this case? Does Azure just clone up another instance? Also what happens in situations where one instance is working on a slower process, it might be waiting for something like a DB transaction. With 2 instance the LB would redirect to instance 2. Logically this sounds superior. It will still work with session vars as MS has implemented "sticky sessions".
I am intrigued that you recommend going with a "small" instance. 1.75GB RAM seems so tiny for a server, and 1 core at 1.6GHz. Need to do some memory monitoring here. Out of interest, how many times would the main application dlls load into RAM, is it just the once regardless of numbers of users? May be a basic question, but just wanted to check. Makes you think when one's laptop is 16GB and 8 cores (i7). However I quess there is a lot of different bloating processes going on a laptop, rather than many fewer and small processes on the server.
Unless your app is particularly memory hungry, I would go for a single small and configure the autoscale to start more servers as needed. Then just keep an eye on the stats. You can have a look at how much memory you are currently using; if it's less than what you get with a small instance you don't get any benefit from the extra RAM.
The SLA for Websites does not require two instances, that rule applies only to Cloud Services.
I have found that you can do a surprisingly large amount of work on single, small instances; I have several systems in that kind of setup which only use a few pct of capacity, even at hundreds of requests per minute. With 10 users you are unlikely to even have IIS use more than one thread, unless you have some very slow responses (I'm assuming you are not using async) so the second core will be idle.
For another example, look at Troy Hunts detailed blog about haveibeenpwned.com which runs on small instances.

How do I confirm whether Application Warm-Up plugin works?

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.

Setting a thread priority in a service has no effect [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Is there some additional configuration needed before I can set thread priorities in a Windows service?
In my service, I have a few threads that each call the CreateProcess() function to launch an external application. I would like to adjust thread (or process) priorities to normal or lower, depending on some other factors.
The problem is that SetThreadPriority() function fails with an error 6 (invalid handle?). I'm passing in a handle obtained from PROCESS_INFORMATION::hThread (after calling the CreateProcess() of course), so I think that the handle should be valid.
I've also tried setting the priority on the processes using the SetPriorityClass() function, which also fails.
The service is logged on as a local user.
Maybe you don't have the correct access rights? MSDN on SetThreadPriority says:
hThread [in] A handle to the thread
whose priority value is to be set.
The handle must have the
THREAD_SET_INFORMATION or
THREAD_SET_LIMITED_INFORMATION access
right. For more information, see
Thread Security and Access Rights.
Windows Server 2003 and Windows
XP/2000: The handle must have the
THREAD_SET_INFORMATION access right.

Resources