Post on 12-May-2015
transcript
Presented By: Mahmoud Ghoz
ASP.NET Performance Secrets
Performance Action Team
22
Agenda
Meet the icons Tips for reducing page load times. Tips for Minimizing HTTP Requests. Quick tips Meet the Tools
Performance Action Team
33
Meet the icons
ASP.NET Developer
Designer
IIS Administrator
Everyone
Performance Action TeamTips for reducing page load times
ASP.NET pipeline optimization
44
Dev
Performance Action Team
55
14 handler are defined in machine.config(4.0)
Tips for reducing page load times
ASP.NET pipeline optimization
Dev
Performance Action Team
ASP.NET process configuration optimization– Defines process level properties like
How many number of threads ASP.NET usesHow many number of threads ASP.NET uses How long it blocks a thread before timing outHow long it blocks a thread before timing out How many requests to keep waiting for IO works to How many requests to keep waiting for IO works to
complete.complete.
66
Tips for reducing page load timesDev
Performance Action Team
ASP.NET process configuration optimization– The default is in many cases too limiting.– Nowadays hardware has become quite cheap
and dual core with gigabyte RAM servers have become a very common choice
77
memoryLimit
minWorkerThreads
maxWorkerThreads (20)
maxIOThreads (20)
minIOThreads
maxAppDomains
Tips for reducing page load timesDev
Performance Action Team
Content Delivery Network (CDN)
88
EdgeCast
Akamai
Limelight
Cachefly
Tips for reducing page load timesAll
Performance Action Team
Making best use of Browser Cache– Cache Static Content for Longer Period– Store cached content under a common folder– Reuse Common Graphics Files– SSL is Not Cached, so Minimize SSL Use – HTTP POST Requests are Never Cached
99
Tips for reducing page load timesAll
Performance Action Team
Making best use of Browser Cache– Use same URLs
1010
www. Ghoz.NET/default.aspx
Ghoz.NET/default.aspx
!=
Tips for reducing page load timesAll
Performance Action Team
Making best use of Browser Cache– Configure Static Content Caching in IIS
1111
Tips for reducing page load timesAdmin
Performance Action Team
1212
Tips for reducing page load times
Making best use of Browser Cache– Configure Static Content Caching in IIS
Admin
Performance Action Team
1313
Tips for reducing page load times
Making best use of Browser Cache– Configure Static Content Caching in IIS
Admin
Performance Action Team
Prevent Denial of Service (DOS) attack – This should bring the server down
1414
When the number of request exceeds the threshold from the same IP, deny further
request for some duration (DYOS)
Tips for reducing page load timesDev
Performance Action Team
Use HTTP compression
1515
Tips for reducing page load times
Fiddler
Dev
Performance Action Team
Use Microsoft AJAX Minifier– Remove unnecessary elements such as
white space, function names, code comments, debug, and trace statements
1616
Tips for reducing page load times
Dev
Performance Action Team
Avoid Redirects
1717
http://astrology.yahoo.com/astrology
A 301 response containing a redirect to
http://astrology.yahoo.com/astrology/
Tips for reducing page load times
Dev
Performance Action Team
Use CSS sprites or Image maps Avoid using tables for layout Choose the appropriate format for
images
1818
Tips for reducing page load times
Designer
Performance Action Team
Don't Scale Images in HTML Make favicon.ico Small and Cacheable Put Style sheets at the Top Put Scripts at the Bottom
1919
Tips for reducing page load times
Designer
Performance Action Team
TIPS FOR MINIMIZING HTTP REQUESTS
2020
Performance Action Team
2121
Fiddler
Remove Unnecessary HeadersAll
Performance Action Team
2222
X-Powered-By: ASP.NET
Remove Unnecessary HeadersAdmin
Performance Action Team
2323
Remove Unnecessary Headers
X-Powered-By: ASP.NET
Admin
Performance Action Team
2424
Remove Unnecessary Headers
X-Powered-By: ASP.NET
Admin
Performance Action Team
2525
Server: Microsoft-IIS/6.0
UrlScan Security Tool
Security tool that restricts the types of HTTP requests that Internet Information Services (IIS) will process
Remove Unnecessary Headers
Server: Microsoft-IIS/7.0
Admin
Dev
Performance Action Team
2626
X-AspNet-Version: 2.0.50727 X-AspNet-Version: 1.1.4322
Remove Unnecessary Headers
X-AspNetMvc-Version: 1.0
Dev
Performance Action Team
QUICK SMALL TIPS
2727
Performance Action Team
Only use ViewState when necessary Set the ScriptManager
LoadScriptsbeforeUI property to false. Combine Client Scripts into a Composite
Script Minimize the content of the UpdatePanel
2828
Quick small tipsDev
Performance Action Team
Make JavaScript and CSS files external Avoid using query parameters in static
content URLs Place CSS inside the head tags Avoid Redirects Caching AJAX calls on browser
– Use Get instead of Post
2929
Quick small tipsDev
Performance Action Team
TOOLS
3030
Performance Action Team
Firebughttps://addons.mozilla.org/en-US/firefox/addon/1843
3131
ToolsDev
Performance Action Team
YSlow https://addons.mozilla.org/en-US/firefox/addon/5369
3232
ToolsDev
Performance Action Team
Httpwatchhttp://www.httpwatch.com/download/
3333
ToolsDev
Performance Action Team
Page-Speed http://code.google.com/speed/page-speed/
3434
ToolsDev
Performance Action Team
Dust-Me Selectors– Firefox extension– it finds out which selectors in the stylesheets used are not used.
http://www.sitepoint.com/dustmeselectors/
3535
ToolsDev
Performance Action Team
Bird-Power– Minify the JavaScript Files– Minify the CSS Files– Mash files together– Validate JavaScript Files– Integrated with Visual Studio
http://www.weirdlover.com/2010/07/18/chirpy-attains-godlike-abilities-in-version-1-0-0-4/
3636
ToolsDev
Performance Action Team
REFERENCE
3737
Performance Action Team
http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx
http://www.4guysfromrolla.com/articles/120209-1.aspx
http://developer.yahoo.com/performance/rules.html
3838
Reference
Performance Action Team
WebClientGuidance 2009-11-30 http://technet.microsoft.com/en-us/
security/cc242650.aspx
3939
Reference
Performance Action Team
4040
Questions
Performance Action Team
4141
Thank You