asp.net 4.0 core runtime enhancements
DESCRIPTION
ASP.Net 4.0 Core runtime enhancements. Sundararajan Subramanian Associate Technical Architect | Aditi Technologies Ltd., http://tinyurl.com/codeshelve | [email protected]. Asp.Net Resource Monitoring. Traditionally monitored at worker process level - PowerPoint PPT PresentationTRANSCRIPT
Interoperabi l i ty w ith Microsoft Technologies
ASP.Net 4.0Core runtime enhancements
Sundararajan SubramanianAssociate Technical Architect | Aditi Technologies Ltd.,http://tinyurl.com/codeshelve | [email protected]
Interoperabi l i ty w ith Microsoft Technologies
Asp.Net Resource MonitoringTraditionally monitored at worker process level
No insight into the individual applications sharing the same worker process.
CLR 4 introduces ARM – Application domain resource management
Enables monitoring resources at individual appdomain level
Interoperabi l i ty w ith Microsoft Technologies
Asp.Net Resource MonitoringASP.NET 4 exposes performance counters built on ARM
Managed Memory Used % Managed Processor Time
Interoperabi l i ty w ith Microsoft Technologies
Asp.Net Resource Monitoring• Enable ARM in aspnet.config file in the
.Net framework directory<?xml version="1.0" encoding="UTF-8" ?> <configuration> <runtime> <appDomainResourceMonitoring enabled="true"/> </runtime> </configuration>
Interoperabi l i ty w ith Microsoft Technologies
Resource Monitoring
DEMO
Interoperabi l i ty w ith Microsoft Technologies
Extensible Request Validation
Write your own custom Request ValidatorsStep1: Inherit from System.Web.Util.RequestValidatorStep2: Override IsValidRequestString(….)Step3: configure custom request validator in web.config<httpRuntime requestValidationType="Samples.MyValidator, Samples" />
Interoperabi l i ty w ith Microsoft Technologies
Request Validation
DEMO
Interoperabi l i ty w ith Microsoft Technologies
Session StateOut-Of-Proc Session State CompressionCompressed using GZIP - System.IO.Compression.GZipStream
<sessionState mode="SqlServer" sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate" allowCustomSqlDatabase="true" compressionEnabled="true" />
Interoperabi l i ty w ith Microsoft Technologies
Auto start Web applicationsIntensive operations to be performed when application starts?First request takes time?Asp.Net 4 + IIS 7.5 + Windows 2008 R2 – Configure Autostart Web apps
Interoperabi l i ty w ith Microsoft Technologies
<applicationpools> <add name="defaultappPool" startMode="AlwaysRunning" /></applicationpools>
<sites> <site name="MySite" id="1"> <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PrewarmMyCache" > <!-- Additional content --> </application> </site>
</sites>
<!-- Additional content -->
<serviceautostartproviders> <add name="PrewarmMyCache" type="MyNamespace.CustomInitialization, MyLibrary" /></serviceautostartproviders>
Interoperabi l i ty w ith Microsoft Technologies
Output CachingCache the response (output) in memory previouslyHigh memory footprint in case of applications with heavy trafficAsp.Net 4.0 provides features to write custom output cache providersCan use any storage mechanism to store HTML content
Interoperabi l i ty w ith Microsoft Technologies
Output cacheCreate Custom output cache provider by inheriting from System.Web.Caching.OutputCacheProviderConfigure the provider in the providers section of the web.config
Interoperabi l i ty w ith Microsoft Technologies
Output Caching
DEMO
Interoperabi l i ty w ith Microsoft Technologies
URL limitPreviously 260 character limit.Extend this character limit in Asp.net 4.0 by config<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" /> requestPathInvalidChars - Configure the set of valid characters in the url<httpRuntime requestPathInvalidChars="<,>,*,%,&,:,\,?" />
Interoperabi l i ty w ith Microsoft Technologies
Other featuresCustom Encoders
encoderType in <httpruntime> elementObject caching
Features of Asp.Net cache brought to other non web applications
RedirectPermanent(..) – HTTP 301
Interoperabi l i ty w ith Microsoft Technologies
ReferencesAsp.Nethttp://www.asp.net/
Interoperabi l i ty w ith Microsoft Technologies
Feedback / QnAYour Feedback is Important!Please take a few moments to fill out our
online feedback form
Use the Question Manager on LiveMeeting to ask your questions now!
Interoperabi l i ty w ith Microsoft Technologies
Contact (optional slide)Code snippets bloghttp://tinyurl.com/codeshelve
http://sundars.netEmail [email protected]
Twitter - @sundararajans
Interoperabi l i ty w ith Microsoft Technologies