【正文】
ces Kernel Caching TCP/IP Send Response Response Cache API Listener Namespace Mapper HTTP Engine HTTP Parser Req. Queue Req. Queue Req. Queue REQUEST Scalability Best Practices Kernel Caching TCP/IP Send Response Response Cache API Listener Namespace Mapper HTTP Engine HTTP Parser Req. Queue Req. Queue Req. Queue REQUEST Scalability Best Practices Kernel Caching TCP/IP Send Response Response Cache API Listener Namespace Mapper HTTP Engine HTTP Parser Req. Queue Req. Queue Req. Queue REQUEST Scalability Best Practices Kernel Caching % OutputCache Location=“Server” … % Scalability Best Practices Kernel Cache, part 2 ? Benefits ? Much faster to serve response – no transition to user mode ? 15k req/s from Kernel Cache vs. req/s from ASPNET output cache ? Lighter load on CPU (though more kernel CPU time) ? Using it in ? Complete responses can be cached by: ? REMEMBER: your application won’t see subsequent requests for this URL after caching once. ? Standard cache flush semantics apply ? If on UNC, be sure to have MaxCmds set high enough ? Otherwise → “failed to start monitoring changes to directory \\svr\share\webcontent” Scalability Best Practices Kernel Cache, part 2 ? Things that would prevent a response from being cached by ? Requests requiring Authentication (AUTHENTICATE) ? Filters installed that are not cacheaware (FilterEnableCache == FALSE [default]) ? Process gets recycled – all cache entries for that process are flushed ? Content changes ? Idle Timeout ? Time out and shut down idle processes if process is idle for given period of time ? Frees resources for active applications ? Apps still available even if worker process idles out and is shut down! ? Demand Start ? Start worker process only if there’s demand for the App Pool ? DemandStartThreshold: only start/run a max of x processes on the server at any time ? Best Practices ? Use Idle Timeout to free up resources for other heavyuse applications ? uses 20mb private bytes w/ASPNET loaded (no applications) ? w/HelloWorld (30 concurrent conns) you go up to 30mb ? Consider disabling idle timeout if app startup takes a long time ? More Pools → consider using more aggressive IdleTimeout to recover memory quicker Scalability Best Practices Idle Timeout and Demand Start Worker process ISAPI Extension ISAPI filter Worker process ISAPI Extension ISAPI filter ? Web Gardens ? App Pool w/ 1 worker process ? Connectionbased routing w/in Garden ? Not processor based (can enable on 1 CPU server) ? Processor Affinitization ? Bind app pool process/es to 1 or more CPUs ? Maskbased configuration Worker process ISAPI Extension ISAPI filter Worker process ISAPI filter Web Garden application pool W3SVC Scalability Best Practices IIS 6 Web Gardens and Processor Affinity Scalability Best Practices Web Gardens and Processor Affinity BPs ? Web Garden Best Practices ? Not beneficial in most cases – only good for following specialized applications: ? Application is multiinstanceable ? Application is not CPUintensive ? Application has synchronous high latency backend (or sync high latency anywhere) ? Affinity Bes