SlideShare a Scribd company logo
1 of 38
Alachisoft 
.NET Performance Solutions 
Four Ways to Improve 
ASP.NET 
Performance & Scalability 
with In-Memory Distributed Cache 
Iqbal Khan 
iqbal@alachisoft.com Ph: +1 (925) 236-2125 
www.alachisoft.com 1
Alachisoft 
ASP.NET is Popular 
for 
High Traffic Web Apps 
It scales nicely to handle 
tens of thousands of concurrent users 
NCache www.alachisoft.com 2
Alachisoft 
Typical ASP.NET Web Farm Deployment 
Mainframe 
Load Balancer 
Web Clients 
ASP.NET Web Farm 
ASP.NET 
Session Storage 
Scale Horizontally 
... 
Database Servers 
NCache www.alachisoft.com 3
Alachisoft 
The Problem 
Scalability Bottlenecks 
Cause application slow-down 
or even crash 
NCache www.alachisoft.com 4
Alachisoft 
Two Data Storage Bottlenecks 
1. App Database cannot Scale 
 Cannot add more database servers 
 Database slows down with more load 
2. ASP.NET Session State Storage has Problems 
 InProc (inside worker process): 
 Cannot handle web garden (multiple worker processes) 
 Requires “sticky session bit” in the load balance 
 Session data loss if a web server goes down 
 StateServer (stand-lone server): 
 Slow performance and cannot scale 
 Session data loss if a StateServer goes down 
 SqlServer 
 SQL Server not ideal for storing BLOBs 
 Performance and scalability issues 
NCache www.alachisoft.com 5
Alachisoft 
Two Data Storage Bottlenecks 
NCache www.alachisoft.com 6
Alachisoft 
ASP.NET View State Bottleneck 
1. ASP.NET View State Travels to the Browser 
 As a hidden string with HTTP Response 
 Browser returns it to web server on HTTP Post Back 
2. ASP.NET View State is Usually Heavy 
 100’s of KB per txn multiplied by millions of txn 
3. Slows Page Response Time 
 Page response times slow down 
4. Increases Bandwidth Consumption Cost 
 You’re paying for bandwidth consumption 
 Cost increases significantly 
NCache www.alachisoft.com 7
Alachisoft 
ASP.NET View State Bottleneck 
Heavy Payload 
(ASP.NET View State) 
Mainframe 
Load Balancer 
Web Clients 
Heavy Payload 
(ASP.NET View State) 
ASP.NET Web Farm 
ASP.NET 
Session Storage 
Scale Horizontally 
... 
Database Servers 
NCache www.alachisoft.com 8
Alachisoft 
Extra Page Execution Bottleneck 
1. Page Output does not Change in Many Cases 
 Entire page output is the same 
 Portions of an otherwise dynamic page are static 
2. ASP.NET Executes Pages Regardless 
 Page is executed even though output does not change 
3. Slows Page Response Time 
 Page response times slow down 
4. Increases Infrastructure Cost 
 Extra CPU, memory, and database resources are consumed 
 Capacity from same set of resources is reduced 
NCache www.alachisoft.com 9
Alachisoft 
Extra Page Execution Bottleneck 
Heavy Payload 
(ASP.NET View State) 
Mainframe 
Load Balancer 
Web Clients 
Heavy Payload 
(ASP.NET View State) 
ASP.NET Web Farm 
ASP.NET 
Session Storage 
Scale Horizontally 
... 
Database Servers 
Extra Page Executions 
(on static output) 
Extra Page Executions 
(on static output) 
NCache www.alachisoft.com 10
Alachisoft 
The Solution 
In-Memory Distributed Cache 
NCache 
NCache www.alachisoft.com 11
Alachisoft 
What is In-Memory Distributed Cache? 
1. Cluster of inexpensive cache servers 
 Pools their memory and CPU 
2. Synchronizes cache updates across the cluster 
 Cache updates immediately visible in the cluster 
3. Linearly scales transaction & memory capacity 
 Just add cache servers to the cluster 
4. Intelligently replicates data for reliability 
 Without compromising performance & scalability 
NCache www.alachisoft.com 12
Alachisoft 
NCache: In-Memory Distributed Cache 
ASP.NET Web Apps WCF Web Services .NET Server Apps 
Distributed Cache Cluster 
Memory pooled from all cache servers 
Scale Horizontally 
Windows 2008/2012 (64-bit) 
Filesystem Database Servers Mainframe 
Big Data Apps 
(.NET) 
NCache www.alachisoft.com 13
Alachisoft 
NCache Performance Benchmarks 
NCache www.alachisoft.com 14
Alachisoft 
ASP.NET Optimizations 
with Distributed Cache 
1. App Data Caching (for Database Bottlenecks) 
 In-memory cache faster than database 
 Cache linearly scalable which database is not 
2. ASP.NET Session State Storage (Reliability) 
 Sessions are replicated for reliability 
 Cache is fast and scalable 
3. ASP.NET View State Cache 
 Cache on server-side and reduce payload size 
4. ASP.NET Output Cache 
 Cache page output 
 Avoid page re-execution 
NCache www.alachisoft.com 15
Alachisoft 
ASP.NET Session State Storage 
NCache www.alachisoft.com 16
Alachisoft 
ASP.NET View State Cache 
NCache www.alachisoft.com 17
Alachisoft 
ASP.NET Output Cache 
NCache www.alachisoft.com 18
Alachisoft 
App Data Caching 
NCache www.alachisoft.com 19
Alachisoft 
Overview of Caching API 
 Connect & Disconnect from the Cache 
 Cache cache = NCache.InitializeCache(“myReplicatedCache”); 
 cache.Dispose(); 
 Read from the Cache 
 object obj = cache.Get(“myKey”); 
 object obj = cache[“myKey”]; 
 bool isPresent = cache.Contains(“myKey”); 
 Add to the Cache 
 cache.Add(“myKey”, obj); 
 cache.Insert(“myKey”, obj); 
 cache[“myKey”] = obj; 
 Remove from the Cache 
 object obj = cache.Remove(“myKey”); 
 Empty the Cache 
 cache.Clear(); 
NCache www.alachisoft.com 20
Alachisoft 
NCache Architecture 
1. High Availability (100% Uptime) 
 Peer to peer cluster 
 Dynamic configuration 
2. Scalability: Caching Topologies 
 Mirrored, Replicated, Partitioned, and Partition-Replica Cache 
NCache www.alachisoft.com 21
Alachisoft 
Cache Elasticity (100% Uptime) 
Dynamic Cache Cluster 
Cache Cluster 
Remote Clients (Web/App Servers) 
Add 
Server 
At 
Runtime 
NCache Srv 
Remove 
Server 
At 
Runtime 
NCache Srv NCache Srv 
 TCP based Cache Cluster 
 Does not use Windows Clustering 
 Peer to peer architecture 
 No single point of failure 
 Add/remove servers at runtime 
 Without stopping cache or your app 
 Data adjusted automatically based 
on caching topology 
 Hot Apply config changes 
 Change config properties while 
cache is running 
NCache www.alachisoft.com 22
Alachisoft 
Cache Elasticity (100% Uptime) 
Dynamic Configuration 
 Cluster membership info 
 Propagate to clients at runtime 
 Cache topology info 
 Propagate to clients at runtime 
 Connection strategy at runtime 
 Connection failover 
 Clients auto-connect to other servers 
NCache Srv 
Remote Clients (Web/App Servers) 
Membership Info 
NCache Srv NCache Srv 
Cache 
Topology Info 
Dynamic Cache Cluster 
Cluster 
NCache www.alachisoft.com 23
Alachisoft 
Caching Topologies 
Mirrored Cache (2-node active/passive) 
Mirrored Cache 
Remote Clients (Web/App Servers) 
Server 1 Server 2 
1 2 
3 Active 
4 
5 6 
1 2 
Passive 
(Backup) 
3 4 
5 6 
Async Backup 
 All clients connect to active node 
 Passive node becomes active if 
active node goes down. Clients 
also automatically connect to new 
active node 
 Mirroring to passive node done 
asynchronously 
 Recommended use: 
 Up to 10 app servers 
 2 cache server cluster 
NCache www.alachisoft.com 24
Alachisoft 
Caching Topologies 
Replicated Cache 
 Each server has the entire cache 
 Cache updates done to all servers 
synchronously. So, they’re slower. 
 Each clients connects to only one 
cache server. All servers active. 
Replicated Cache 
Remote Clients (Web/App Servers) 
 Good for read-intensive scenarios Server 1 Server 2 
1 2 
3 Active 
4 
5 6 
1 2 
3 Active 
4 
5 6 
Synchronous Updates 
NCache www.alachisoft.com 25
Alachisoft 
Caching Topologies 
Partitioned Cache 
 Extremely scalable 
 Location transparency 
 Good for large cache clusters 
 Distribution map sent to all clients 
at runtime 
 No replication available 
Partitioned Cache 
Remote Clients (Web/App Servers) 
Distribution 
Partition 1 
1 2 
Distribution 
Partition 2 
3 4 
Server 1 Server 2 
Map 
Map 
NCache www.alachisoft.com 26
Alachisoft 
Caching Topologies 
Partition-Replica Cache 
 Each partition has one replica on a 
different server. All created 
automatically. 
 Async & Sync replication options 
 Extremely fast & scalable 
 Reliability due to replicas 
Partition-Replica Cache 
Remote Clients (Web/App Servers) 
Distribution 
Partition 1 
1 2 
Replica 2 
3 4 
Distribution 
Partition 2 
3 4 
Replica 1 
1 2 
Server 1 Server 2 
Map 
Map 
NCache www.alachisoft.com 27
Alachisoft 
Caching Topologies 
Client Cache 
NCache Client Nodes 
Web/App Server 
... Web/App Server 
(Client Node) (Client Node) 
Client Cache Client Cache 
Synchronized Synchronized 
Cache Cluster 
Dynamic Clustered Cache 
Server 1 Server 2 
3 4 
Server 3 
3 4 
1 2 
5 6 
1 2 
3 4 
5 6 
Cached Item 
1 2 
5 6 
 Local cache on client nodes (in-process 
and out-of-process) 
 Automatically synchronizes with 
clustered cache. Optimistic & 
pessimistic synch options. 
 No special programming needed. 
Plug in thru config changes. 
 Good for read-intensive scenarios 
NCache www.alachisoft.com 28
Alachisoft 
Hands on Demo 
NCache www.alachisoft.com 29
Alachisoft 
Some Object Caching Features 
 Expirations 
 Absolute-time + idle-time 
 Auto-reload data on expiration (if read-thru enabled) 
 Locking (Pessimistic & Optimistic) 
 Lock/Unlock for pessimistic locking (writer-lock) 
 Object versioning for optimistic locking (reader-lock) 
 Bulk Operations 
 Bulk Get, Add, Insert, and Remove 
 Async Operations 
 Async Add, Insert, and Remove 
NCache www.alachisoft.com 30
Alachisoft 
Handling Relational Data in Cache 
 Cache Dependency 
 Key based 
 One-to-one, one-to-many, and many-to-many 
 Let cache manage relationships for you 
 Cache invalidates related data when a cached item is updated/removed 
NCache www.alachisoft.com 31
Alachisoft 
Synchronize Cache with Data Sources 
 Synchronize with Relational Databases (SQL, Oracle, etc.) 
 SqlDependency 
 OracleDependency 
 DbDependency 
 Synchronize with non-Relational Data Sources 
 File based Cache Dependency 
 Custom Cache Dependency 
NCache www.alachisoft.com 32
Alachisoft 
Data Grouping in the Cache 
 Group/Subgroup 
 Tags 
 Named Tags 
NCache www.alachisoft.com 33
Alachisoft 
Searching the Cache 
 Parallel Queries with Object Query Language (OQL) 
 SQL-like query language to search cache based on object attributes 
 Parallel LINQ Queries 
 Standard LINQ queries can search the cache 
 Indexing Object Attributes for Querying 
 Create indexes on object attributes to speed up queries 
NCache www.alachisoft.com 34
Alachisoft 
Read-thru, Write-thru, Write-behind 
 Read-through and write-through 
 You implement read-thru and write-thru handlers called by NCache 
 Write-behind 
 Write-through has write-behind option that queues up database updates 
 Database update queue replicated to multiple servers for reliability 
 Reload Items on Expiration or Db Sync 
 Use Read-thru to reload item from its data source instead of removing it 
NCache www.alachisoft.com 35
Alachisoft 
Runtime Data Sharing with Messaging 
 Key Based Event Notifications 
 Register interest in specific cached items to be notified at insert/remove 
 Register interest to be notified at ALL add/insert/remove (off by default) 
 Send custom notifications to other NCache clients (cluster wide) 
 General Purpose Event Notifications 
 Register interest to be notified at ALL add/insert/remove (off by default) 
 Custom Event Notifications 
 Apps fire custom event notifications into NCache cluster 
 Other apps are notified 
 Continuous Queries Events 
 SQL-Like query to specify dataset 
 Event notifications fired when dataset changes in the cache cluster 
NCache www.alachisoft.com 36
Alachisoft 
Some Other Features 
 NHibernate L2 Cache Provider 
 Plug into NHibernate application without any code change 
 Entity Framework L2 Cache 
 Plug into Entity Framework application without any code change 
 Dynamic Compact Serialization 
 Faster and more compact then regular .NET serialization 
 No code writing required 
NCache www.alachisoft.com 37
Alachisoft 
Next Steps 
 Download NCache 60-Day Trial (Fully Working) 
 http://www.alachisoft.com/download.html 
 Contact us for Personalized Architectural Demo 
 Email: sales@alachisoft.com. Phone: +1 (925) 236-3830 
NCache www.alachisoft.com 38

More Related Content

What's hot

The RDBMS You Should Be Using
The RDBMS You Should Be UsingThe RDBMS You Should Be Using
The RDBMS You Should Be Using
ColdFusionConference
 
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAXAlpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Richard Rabins
 

What's hot (20)

Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
 
Oracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New FeaturesOracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New Features
 
The RDBMS You Should Be Using
The RDBMS You Should Be UsingThe RDBMS You Should Be Using
The RDBMS You Should Be Using
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql Azure
 
PDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service Application
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
 
SQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12cSQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12c
 
Microsoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query Tuning
 
New lessons in connection management
New lessons in connection managementNew lessons in connection management
New lessons in connection management
 
Drupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp NorthDrupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp North
 
Building Web APIs that Scale
Building Web APIs that ScaleBuilding Web APIs that Scale
Building Web APIs that Scale
 
Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)
 
ChinaNetCloud - Using Zabbix Monitoring at Scale - Zabbix Conference 2014
ChinaNetCloud - Using Zabbix Monitoring at Scale - Zabbix Conference 2014ChinaNetCloud - Using Zabbix Monitoring at Scale - Zabbix Conference 2014
ChinaNetCloud - Using Zabbix Monitoring at Scale - Zabbix Conference 2014
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL ServerEnd-to-end Troubleshooting Checklist for Microsoft SQL Server
End-to-end Troubleshooting Checklist for Microsoft SQL Server
 
How to Make SQL Server Go Faster
How to Make SQL Server Go FasterHow to Make SQL Server Go Faster
How to Make SQL Server Go Faster
 
Pratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développementPratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développement
 
Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...
Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...
Unbreakable SharePoint 2013 with SQL Server Always On Availability Groups (HA...
 
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAXAlpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
 
Oh2 opportunity for_smart_db
Oh2 opportunity for_smart_dbOh2 opportunity for_smart_db
Oh2 opportunity for_smart_db
 
Sherlock Homepage - A detective story about running large web services - NDC ...
Sherlock Homepage - A detective story about running large web services - NDC ...Sherlock Homepage - A detective story about running large web services - NDC ...
Sherlock Homepage - A detective story about running large web services - NDC ...
 

Viewers also liked (6)

NCache 3.8 SP3
NCache 3.8 SP3NCache 3.8 SP3
NCache 3.8 SP3
 
OpenROV: Node.js takes a dive into the ocean
OpenROV: Node.js takes a dive into the oceanOpenROV: Node.js takes a dive into the ocean
OpenROV: Node.js takes a dive into the ocean
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC Applications
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Introduction to ADO.NET
Introduction to ADO.NETIntroduction to ADO.NET
Introduction to ADO.NET
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 

Similar to Four Ways to Improve ASP .NET Performance and Scalability

Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
Wim Van den Broeck
 
Sharepoint Performance - part 2
Sharepoint Performance - part 2Sharepoint Performance - part 2
Sharepoint Performance - part 2
Regroove
 
Oracle 10g rac_overview
Oracle 10g rac_overviewOracle 10g rac_overview
Oracle 10g rac_overview
Robel Parvini
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
ColdFusionConference
 

Similar to Four Ways to Improve ASP .NET Performance and Scalability (20)

Application Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCacheApplication Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCache
 
NCache Architecture
NCache ArchitectureNCache Architecture
NCache Architecture
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
slides (PPT)
slides (PPT)slides (PPT)
slides (PPT)
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Handling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed CacheHandling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed Cache
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash VMworld 2013: Extreme Performance Series: Storage in a Flash
VMworld 2013: Extreme Performance Series: Storage in a Flash
 
Sharepoint Performance - part 2
Sharepoint Performance - part 2Sharepoint Performance - part 2
Sharepoint Performance - part 2
 
Oracle 10g rac_overview
Oracle 10g rac_overviewOracle 10g rac_overview
Oracle 10g rac_overview
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
SQL AlwaysON for SharePoint HA/DR on Azure Global Azure Bootcamp 2017 Eisenac...
SQL AlwaysON for SharePoint HA/DR on Azure Global Azure Bootcamp 2017 Eisenac...SQL AlwaysON for SharePoint HA/DR on Azure Global Azure Bootcamp 2017 Eisenac...
SQL AlwaysON for SharePoint HA/DR on Azure Global Azure Bootcamp 2017 Eisenac...
 
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionAdvanced caching techniques with ehcache, big memory, terracotta, and coldfusion
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusion
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibility
 
Will it Scale? The Secrets behind Scaling Stream Processing Applications
Will it Scale? The Secrets behind Scaling Stream Processing ApplicationsWill it Scale? The Secrets behind Scaling Stream Processing Applications
Will it Scale? The Secrets behind Scaling Stream Processing Applications
 
Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...
 
11g R2
11g R211g R2
11g R2
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Four Ways to Improve ASP .NET Performance and Scalability

  • 1. Alachisoft .NET Performance Solutions Four Ways to Improve ASP.NET Performance & Scalability with In-Memory Distributed Cache Iqbal Khan iqbal@alachisoft.com Ph: +1 (925) 236-2125 www.alachisoft.com 1
  • 2. Alachisoft ASP.NET is Popular for High Traffic Web Apps It scales nicely to handle tens of thousands of concurrent users NCache www.alachisoft.com 2
  • 3. Alachisoft Typical ASP.NET Web Farm Deployment Mainframe Load Balancer Web Clients ASP.NET Web Farm ASP.NET Session Storage Scale Horizontally ... Database Servers NCache www.alachisoft.com 3
  • 4. Alachisoft The Problem Scalability Bottlenecks Cause application slow-down or even crash NCache www.alachisoft.com 4
  • 5. Alachisoft Two Data Storage Bottlenecks 1. App Database cannot Scale  Cannot add more database servers  Database slows down with more load 2. ASP.NET Session State Storage has Problems  InProc (inside worker process):  Cannot handle web garden (multiple worker processes)  Requires “sticky session bit” in the load balance  Session data loss if a web server goes down  StateServer (stand-lone server):  Slow performance and cannot scale  Session data loss if a StateServer goes down  SqlServer  SQL Server not ideal for storing BLOBs  Performance and scalability issues NCache www.alachisoft.com 5
  • 6. Alachisoft Two Data Storage Bottlenecks NCache www.alachisoft.com 6
  • 7. Alachisoft ASP.NET View State Bottleneck 1. ASP.NET View State Travels to the Browser  As a hidden string with HTTP Response  Browser returns it to web server on HTTP Post Back 2. ASP.NET View State is Usually Heavy  100’s of KB per txn multiplied by millions of txn 3. Slows Page Response Time  Page response times slow down 4. Increases Bandwidth Consumption Cost  You’re paying for bandwidth consumption  Cost increases significantly NCache www.alachisoft.com 7
  • 8. Alachisoft ASP.NET View State Bottleneck Heavy Payload (ASP.NET View State) Mainframe Load Balancer Web Clients Heavy Payload (ASP.NET View State) ASP.NET Web Farm ASP.NET Session Storage Scale Horizontally ... Database Servers NCache www.alachisoft.com 8
  • 9. Alachisoft Extra Page Execution Bottleneck 1. Page Output does not Change in Many Cases  Entire page output is the same  Portions of an otherwise dynamic page are static 2. ASP.NET Executes Pages Regardless  Page is executed even though output does not change 3. Slows Page Response Time  Page response times slow down 4. Increases Infrastructure Cost  Extra CPU, memory, and database resources are consumed  Capacity from same set of resources is reduced NCache www.alachisoft.com 9
  • 10. Alachisoft Extra Page Execution Bottleneck Heavy Payload (ASP.NET View State) Mainframe Load Balancer Web Clients Heavy Payload (ASP.NET View State) ASP.NET Web Farm ASP.NET Session Storage Scale Horizontally ... Database Servers Extra Page Executions (on static output) Extra Page Executions (on static output) NCache www.alachisoft.com 10
  • 11. Alachisoft The Solution In-Memory Distributed Cache NCache NCache www.alachisoft.com 11
  • 12. Alachisoft What is In-Memory Distributed Cache? 1. Cluster of inexpensive cache servers  Pools their memory and CPU 2. Synchronizes cache updates across the cluster  Cache updates immediately visible in the cluster 3. Linearly scales transaction & memory capacity  Just add cache servers to the cluster 4. Intelligently replicates data for reliability  Without compromising performance & scalability NCache www.alachisoft.com 12
  • 13. Alachisoft NCache: In-Memory Distributed Cache ASP.NET Web Apps WCF Web Services .NET Server Apps Distributed Cache Cluster Memory pooled from all cache servers Scale Horizontally Windows 2008/2012 (64-bit) Filesystem Database Servers Mainframe Big Data Apps (.NET) NCache www.alachisoft.com 13
  • 14. Alachisoft NCache Performance Benchmarks NCache www.alachisoft.com 14
  • 15. Alachisoft ASP.NET Optimizations with Distributed Cache 1. App Data Caching (for Database Bottlenecks)  In-memory cache faster than database  Cache linearly scalable which database is not 2. ASP.NET Session State Storage (Reliability)  Sessions are replicated for reliability  Cache is fast and scalable 3. ASP.NET View State Cache  Cache on server-side and reduce payload size 4. ASP.NET Output Cache  Cache page output  Avoid page re-execution NCache www.alachisoft.com 15
  • 16. Alachisoft ASP.NET Session State Storage NCache www.alachisoft.com 16
  • 17. Alachisoft ASP.NET View State Cache NCache www.alachisoft.com 17
  • 18. Alachisoft ASP.NET Output Cache NCache www.alachisoft.com 18
  • 19. Alachisoft App Data Caching NCache www.alachisoft.com 19
  • 20. Alachisoft Overview of Caching API  Connect & Disconnect from the Cache  Cache cache = NCache.InitializeCache(“myReplicatedCache”);  cache.Dispose();  Read from the Cache  object obj = cache.Get(“myKey”);  object obj = cache[“myKey”];  bool isPresent = cache.Contains(“myKey”);  Add to the Cache  cache.Add(“myKey”, obj);  cache.Insert(“myKey”, obj);  cache[“myKey”] = obj;  Remove from the Cache  object obj = cache.Remove(“myKey”);  Empty the Cache  cache.Clear(); NCache www.alachisoft.com 20
  • 21. Alachisoft NCache Architecture 1. High Availability (100% Uptime)  Peer to peer cluster  Dynamic configuration 2. Scalability: Caching Topologies  Mirrored, Replicated, Partitioned, and Partition-Replica Cache NCache www.alachisoft.com 21
  • 22. Alachisoft Cache Elasticity (100% Uptime) Dynamic Cache Cluster Cache Cluster Remote Clients (Web/App Servers) Add Server At Runtime NCache Srv Remove Server At Runtime NCache Srv NCache Srv  TCP based Cache Cluster  Does not use Windows Clustering  Peer to peer architecture  No single point of failure  Add/remove servers at runtime  Without stopping cache or your app  Data adjusted automatically based on caching topology  Hot Apply config changes  Change config properties while cache is running NCache www.alachisoft.com 22
  • 23. Alachisoft Cache Elasticity (100% Uptime) Dynamic Configuration  Cluster membership info  Propagate to clients at runtime  Cache topology info  Propagate to clients at runtime  Connection strategy at runtime  Connection failover  Clients auto-connect to other servers NCache Srv Remote Clients (Web/App Servers) Membership Info NCache Srv NCache Srv Cache Topology Info Dynamic Cache Cluster Cluster NCache www.alachisoft.com 23
  • 24. Alachisoft Caching Topologies Mirrored Cache (2-node active/passive) Mirrored Cache Remote Clients (Web/App Servers) Server 1 Server 2 1 2 3 Active 4 5 6 1 2 Passive (Backup) 3 4 5 6 Async Backup  All clients connect to active node  Passive node becomes active if active node goes down. Clients also automatically connect to new active node  Mirroring to passive node done asynchronously  Recommended use:  Up to 10 app servers  2 cache server cluster NCache www.alachisoft.com 24
  • 25. Alachisoft Caching Topologies Replicated Cache  Each server has the entire cache  Cache updates done to all servers synchronously. So, they’re slower.  Each clients connects to only one cache server. All servers active. Replicated Cache Remote Clients (Web/App Servers)  Good for read-intensive scenarios Server 1 Server 2 1 2 3 Active 4 5 6 1 2 3 Active 4 5 6 Synchronous Updates NCache www.alachisoft.com 25
  • 26. Alachisoft Caching Topologies Partitioned Cache  Extremely scalable  Location transparency  Good for large cache clusters  Distribution map sent to all clients at runtime  No replication available Partitioned Cache Remote Clients (Web/App Servers) Distribution Partition 1 1 2 Distribution Partition 2 3 4 Server 1 Server 2 Map Map NCache www.alachisoft.com 26
  • 27. Alachisoft Caching Topologies Partition-Replica Cache  Each partition has one replica on a different server. All created automatically.  Async & Sync replication options  Extremely fast & scalable  Reliability due to replicas Partition-Replica Cache Remote Clients (Web/App Servers) Distribution Partition 1 1 2 Replica 2 3 4 Distribution Partition 2 3 4 Replica 1 1 2 Server 1 Server 2 Map Map NCache www.alachisoft.com 27
  • 28. Alachisoft Caching Topologies Client Cache NCache Client Nodes Web/App Server ... Web/App Server (Client Node) (Client Node) Client Cache Client Cache Synchronized Synchronized Cache Cluster Dynamic Clustered Cache Server 1 Server 2 3 4 Server 3 3 4 1 2 5 6 1 2 3 4 5 6 Cached Item 1 2 5 6  Local cache on client nodes (in-process and out-of-process)  Automatically synchronizes with clustered cache. Optimistic & pessimistic synch options.  No special programming needed. Plug in thru config changes.  Good for read-intensive scenarios NCache www.alachisoft.com 28
  • 29. Alachisoft Hands on Demo NCache www.alachisoft.com 29
  • 30. Alachisoft Some Object Caching Features  Expirations  Absolute-time + idle-time  Auto-reload data on expiration (if read-thru enabled)  Locking (Pessimistic & Optimistic)  Lock/Unlock for pessimistic locking (writer-lock)  Object versioning for optimistic locking (reader-lock)  Bulk Operations  Bulk Get, Add, Insert, and Remove  Async Operations  Async Add, Insert, and Remove NCache www.alachisoft.com 30
  • 31. Alachisoft Handling Relational Data in Cache  Cache Dependency  Key based  One-to-one, one-to-many, and many-to-many  Let cache manage relationships for you  Cache invalidates related data when a cached item is updated/removed NCache www.alachisoft.com 31
  • 32. Alachisoft Synchronize Cache with Data Sources  Synchronize with Relational Databases (SQL, Oracle, etc.)  SqlDependency  OracleDependency  DbDependency  Synchronize with non-Relational Data Sources  File based Cache Dependency  Custom Cache Dependency NCache www.alachisoft.com 32
  • 33. Alachisoft Data Grouping in the Cache  Group/Subgroup  Tags  Named Tags NCache www.alachisoft.com 33
  • 34. Alachisoft Searching the Cache  Parallel Queries with Object Query Language (OQL)  SQL-like query language to search cache based on object attributes  Parallel LINQ Queries  Standard LINQ queries can search the cache  Indexing Object Attributes for Querying  Create indexes on object attributes to speed up queries NCache www.alachisoft.com 34
  • 35. Alachisoft Read-thru, Write-thru, Write-behind  Read-through and write-through  You implement read-thru and write-thru handlers called by NCache  Write-behind  Write-through has write-behind option that queues up database updates  Database update queue replicated to multiple servers for reliability  Reload Items on Expiration or Db Sync  Use Read-thru to reload item from its data source instead of removing it NCache www.alachisoft.com 35
  • 36. Alachisoft Runtime Data Sharing with Messaging  Key Based Event Notifications  Register interest in specific cached items to be notified at insert/remove  Register interest to be notified at ALL add/insert/remove (off by default)  Send custom notifications to other NCache clients (cluster wide)  General Purpose Event Notifications  Register interest to be notified at ALL add/insert/remove (off by default)  Custom Event Notifications  Apps fire custom event notifications into NCache cluster  Other apps are notified  Continuous Queries Events  SQL-Like query to specify dataset  Event notifications fired when dataset changes in the cache cluster NCache www.alachisoft.com 36
  • 37. Alachisoft Some Other Features  NHibernate L2 Cache Provider  Plug into NHibernate application without any code change  Entity Framework L2 Cache  Plug into Entity Framework application without any code change  Dynamic Compact Serialization  Faster and more compact then regular .NET serialization  No code writing required NCache www.alachisoft.com 37
  • 38. Alachisoft Next Steps  Download NCache 60-Day Trial (Fully Working)  http://www.alachisoft.com/download.html  Contact us for Personalized Architectural Demo  Email: sales@alachisoft.com. Phone: +1 (925) 236-3830 NCache www.alachisoft.com 38