views:

542

answers:

3

Hello,

we are using windows 2003 server with dual CPU and IIS gets overflown with requests and not able to handle them but at the same time it uses less than 20% of the CPU and less than 40% of ram. When server is not able to serve any requests not only its not possible to browse the site but its not even serving images which are used on our other sites. We are thinking of installing VMWare to have 2 servers on this machine and using one server to serve asp.net pages and the other one to serve images and simple html pages. Do you guys know how we can route image and html pages requests to one server and requests for aspx pages to another?

Any ideas are appreciated.

Thank you, Denis

+5  A: 
  1. What is the state of the network? 100mb at 100%?
  2. In IIS Are you limiting # of connections? are you limiting Bandwidth?
  3. Are there Server errors in the server event log?
  4. What is you Database Activity? is is the database bottle necking your webserver?
  5. is the DB Network util very high as well? do the DB and webserver talk over the same network? some web servers have 2 network cards, the db and webserver should no share the same bandwidth with external traffic, put external traffic on one network and internal comm on a "backend" network
  6. Do you have ANY caching enabled? output, data?

You should be sure that proper data caching is used.

http://msdn.microsoft.com/en-us/library/ms972379.aspx

You should try using a CDN ( content delivery network ) or deploy your own CR ( Content Repository ) server, with different urls than you Website:

  • www.yoursite.com/index.aspx

your images / css / js can all be servered from a CR server

  • www.yourcdn.com/images/bigImage.jpg

or

  • cdn.yoursite.com/images/bigImage.jpg

or

  • cr.yoursite.com/images/bigImage.jpg

Since your web server CPU util is so low, try adding HTTP compression to lower some of the network util as per David's good comment

BigBlondeViking
+1 for suggesting CDN.
RichardOD
Thanks for the response.1. Yes, network is 100mb at 100%.2. We used to limit them but under a ddos attack most of them are filled with attacking ips so its not a good solution.3. Don't think there are any errors but will check.4. Database is located on a separate server.5. will check on it.
is the db network maxed too? is the db on the same network? at the firewall can you see how much traffic is inbound to the network?
BigBlondeViking
shoot, sorry the network is 100% up, the usage is less than 10% of 100mb for both application server and db server.
sorry, to confirm the traffic between the web server and db server is only 10% of your 100mb network, 90+% of your traffic is external request to web server?
BigBlondeViking
no, the external traffic to the application server is less than 10% of the 100mb (about 5%). We have a lot of room with bandwidth, its not a problem.
Also with images, we are not able to change image URLs, we have a lot of other sites using our images including our own ebay store with thousands of items posted with thousands and thousands of images all using the current URL, so we need to keep it for all those images to be displayed.
to be honest, i don't think its IIS that is the issue, if your network is not maxed out... then the machine would be handling all the requests fine. You might want to inspect you firewall, check the logs to see if connections are getting rejected.
BigBlondeViking
+1  A: 

BigBlondeViking has a few good points.

But I want to add that putting 2 VM's on the machine probably won't help you much. What we do (and I would recommend to anyone) is have 2 layers of servers:

  • Web Server(s) running Apache in the DMZ
    • these serve your images, css, js and other static content
    • does ssl
    • also used as a reverse proxy server (using mod_proxy)
  • Application Server(s) running IIS
    • these serve your ASP.NET pages

This helps add a level of scalability and security to your site.

Sample Apache mod_proxy config:

<VirtualHost 555.55.555.555:80>
ServerName domain.com
DocumentRoot c:/docroot

ProxyPass /img !
ProxyPass /js !
ProxyPass /css !
ProxyPass / http://serverA/vdir
ProxyPassReverse / http://serverA/vdir
</VirtualHost>

This will proxy all requests to / and any subdirs except img, js, and css to serverA/vdir

consultutah
Yeah, I like the solution, but its no good for us right now as for this set up the image urls and others will need to be changed, which is a problem for us, the URLs must stay the same as they are right now.
You actually wouldn't need to change the URLS as long as the static stuff is in its own directory:http://mysite.com/images/http://mysite.com/js/http://mysite.com/default.aspxThe rules in Apache can distinguish between the directories and only reverse proxy things that are not in static directories.
consultutah
Very interesting. Could you please post a link where I can get more info about such a set up?Thank you.
You definitely want to start with Apache's documentation for the proxypass directive: (http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypass)Since these comments don't allow formatting, I'll edit the answer above.
consultutah
Got it. thanks a lot.
+4  A: 

If your network is at 100% and your CPU is at 40% then adding more processing power and/or virtualizing machines isn't going to help. You can either add more bandwidth (how depends on hosting situation) or use a CDN like BigBlondeViking suggests or reduce bandwidth usage on your app (exactly how depends on app). Easiest option is really a CDN in most cases.

Now, once you get this bandwidth bottleneck solved you might start having CPU usage problems as the number of requests you can handle will increase dramatically.

Wyatt Barnett
Also make sure that compression is enabled.
David
+1, bandwidth bottle neck: i think a diagnosis on where the bottleneck is needs to be resolved... is it coming from outside his network or inside? if the internet requests are on 40% of the traffic and his DB is the other 60+% or is the internet is 90+% and his DB is 10% i would say the 2 have different resolutions...
BigBlondeViking