SlideShare uma empresa Scribd logo
1 de 20
Scalable Performance


Building enterprise-scale web applications that perform
Scalability vs. Performance



 • Ratio of the increase in          • Serving a single request in the
   throughput to an increase in        shortest amount of time
   resources                         • Inverse of latency
 • Support additional users at the
   least incremental cost
 • Predictability of application
   behavior as users are added
Scalable Performance



 • Number of requests that can be concurrently served
   (throughput) while meeting a minimum level of service
   (response time)
 • Measuring:
     o   Resource utilization
     o   Throughput
     o   Response time
Horizontal vs. Vertical Scaling



 • Increase the hardware resources       • Improve hardware capabilities
 • Separate types of processing into       (cpu, RAM, storage, etc…)
   tiers                                 • No network bottleneck
 • Commodity hardware is a               • Becomes increasingly expensive
   predictable cost per user             • Practical and financial limitations
 • Limitations to scaling are dictated     to the ability to scale
   by application architecture           • Typically increases performance
 • Can degrade performance
Horizontal vs. Vertical Scaling
General Observations



 • Performance decreases in each later tier (LB > web > app >
   DB) due to increasing complexity
     o   Service requests in the earliest possible tier
 • Costs of scalability increases in each later tier (LB < web <
   app < DB)
     o   Architect bottlenecks in the earliest possible tier
 • Scalable performance is ultimately limited by the operations
   that do not scale linearly
 • Ideally, each request that makes it to the database tier
   would have its own connection
     o   Realistically, this means serving requests in earlier tiers because of
         constraints to db scaling
JEE Request Processing
Application Bottlenecks



 •   Thread starvation
 •   Thread contention
 •   IO contention
 •   IO performance
 •   Memory limitations
 •   Data access
Resource Utilization
Resource Capacity Settings



 •   Database CPUs
 •   Database connection pool
 •   Application server CPUs
 •   Application server thread pool
 •   JVM Heap settings
 •   Web server thread pool
Resource Capacity Settings



 • Walk through the application architecture and identify the
   points where a request could potentially wait.
 • Open all wait points.
 • Generate balanced and representative load against the
   environment.
 • Identify the limiting wait point’s saturation point.
 • Tighten all wait points to facilitate only the maximum load of
   the limiting wait point.
 • Force all pending requests to wait at the Web server.
 • Add more resources.
Profiling



 •   Long running http requests
 •   Long running methods
 •   Memory leaks
 •   Deadlocks
 •   Long running queries
Database Tier



 • System of record
 • Difficult to scale horizontally and expensive to scale
   vertically
 • Keep connections limited to what the server will support
     o   Block at the app tier
 • Perform data processing on staging server
 • Each database has its own optimization techniques
     o   Explain plan to locate and eliminate full table scans
     o   Query and table caches
     o   Buffer sizes
Application Tier



 • Generally cannot be stateless due to security and business
   requirements
 • Sticky vs. clustered sessions
     o   Use the HTTPSession sparingly
     o   If the app does not need to be HA, it may not require clean failover
         and can drop sessions
 • Scaling horizontally could potentially put more load on the
   DB
     o   Caching can be used to offset the load
Application Caching



 • Read-only data can be cached like static data in the web
   tier
 • Write-able data can be cached but will impose limitations on
   clustering
     o   Will probably either need to be in-sync across the cluster or turned off
         completely
 • Filters can provide caching of dynamic, secure data at the
   earliest point in this tier
     o   Caches entire response
     o   Not recommended for user-specific data
 • Service layer or data access caches provide a simple way
   to stop requests from continuing to the database
     o   Transparent to the calling code
     o   Cache interceptors
Tomcat Tuning



 • maxThreads controls actively served connections
 • backlog controls the number of connections that can be
   queued
 • maxThreads + backlog = total accepted connections
 • connectionTimeout can be used to drop faulty connections
 • bufferSize is by default set to -1, no buffering of output
 • Keep heap size manageable, < 2GB
Web Tier



 • Clustering is easiest in the web tier because they are
   generally stateless
 • Web tier clustering can provide super-linear scaling (IO
   contention, context switching costs)
 • The web tier should serve all static data (images, static
   html)
 • The web tier can serve dynamic requests by caching non-
   secure data that only depends upon url parameters
     o   Squid reverse proxy
     o   Apache mod cache
     o   Memcached
Apache Tuning



 • Limit connections in the web tier to prevent overloading
   later tiers (MaxClients)
 • ServerLimit x Memory per process < RAM available to limit
   swapping
 • Avg connections = ThreadsPerChild x Apache hosts / App
   Server hosts
 • ProxyPass max = ThreadsPerChild
Other



 • Grid Caches
        o   GigaSpaces
        o   Coherence
 • CDN
        o   Akamai
 • Compute Appliances
        o   Azul Systems
References



 • http://www.theserverside.com/tt/articles/content/JIApresent
   ations/JIA-HASP.pdf
 • http://www.mnot.net/cache_docs/
 • http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
 • http://www.yourkit.com/overview/index.jsp
 • http://dev2dev.bea.com/pub/a/2006/05/declarative-
   caching.html
 • http://azulsystems.com/
 • http://www.theserverside.com/tt/knowledgecenter/knowledg
   ecenter.tss?l=ProJavaEE_Ch06

Mais conteúdo relacionado

Mais procurados

Cloud Design Pattern part2
Cloud Design Pattern part2Cloud Design Pattern part2
Cloud Design Pattern part2Masashi Narumoto
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introductionDong Ngoc
 
The experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare networkThe experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare networkgeorge.james
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructuregeorge.james
 
Datasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafDatasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafMidVision
 
HBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at DidiHBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at DidiHBaseCon
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构Benjamin Tan
 
Server load balancer ppt
Server load balancer pptServer load balancer ppt
Server load balancer pptShilpi Tandon
 
MariaDB High Availability Webinar
MariaDB High Availability WebinarMariaDB High Availability Webinar
MariaDB High Availability WebinarMariaDB plc
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Patrick Meenan
 
Change Data Capture using Kafka
Change Data Capture using KafkaChange Data Capture using Kafka
Change Data Capture using KafkaAkash Vacher
 
Benchmarking Performance and Scalability with Web Stress
Benchmarking Performance and Scalability with Web StressBenchmarking Performance and Scalability with Web Stress
Benchmarking Performance and Scalability with Web StressInterSystems Corporation
 
Weblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingWeblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingUnmesh Baile
 
Seda与Java并行编程点滴
Seda与Java并行编程点滴Seda与Java并行编程点滴
Seda与Java并行编程点滴Benjamin Tan
 
SAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilityGary Jackson MBCS
 
System design for video streaming service
System design for video streaming serviceSystem design for video streaming service
System design for video streaming serviceNirmik Kale
 
Peer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsPeer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsKarthick Jokirathinam
 
Load Balancing
Load BalancingLoad Balancing
Load Balancingnashniv
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLSTC2B2 Consulting
 

Mais procurados (20)

Cloud Design Pattern part2
Cloud Design Pattern part2Cloud Design Pattern part2
Cloud Design Pattern part2
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introduction
 
The experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare networkThe experiences of migrating a large scale, high performance healthcare network
The experiences of migrating a large scale, high performance healthcare network
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
 
Datasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmrafDatasheet weblogic midvisionextensionforibmraf
Datasheet weblogic midvisionextensionforibmraf
 
HBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at DidiHBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at Didi
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
 
Server load balancer ppt
Server load balancer pptServer load balancer ppt
Server load balancer ppt
 
MariaDB High Availability Webinar
MariaDB High Availability WebinarMariaDB High Availability Webinar
MariaDB High Availability Webinar
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
Change Data Capture using Kafka
Change Data Capture using KafkaChange Data Capture using Kafka
Change Data Capture using Kafka
 
Benchmarking Performance and Scalability with Web Stress
Benchmarking Performance and Scalability with Web StressBenchmarking Performance and Scalability with Web Stress
Benchmarking Performance and Scalability with Web Stress
 
Weblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingWeblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-training
 
Seda与Java并行编程点滴
Seda与Java并行编程点滴Seda与Java并行编程点滴
Seda与Java并行编程点滴
 
SAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High Availability
 
System design for video streaming service
System design for video streaming serviceSystem design for video streaming service
System design for video streaming service
 
Peer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clientsPeer Cache for Configuration Manager clients
Peer Cache for Configuration Manager clients
 
Load Balancing
Load BalancingLoad Balancing
Load Balancing
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 

Destaque

Presentasi Message Confidentiality (Kerahasiaan Pesan)
Presentasi Message Confidentiality (Kerahasiaan Pesan)Presentasi Message Confidentiality (Kerahasiaan Pesan)
Presentasi Message Confidentiality (Kerahasiaan Pesan)Uliel Azmie
 
4 sem pathology - 2005 to 2010 1
4 sem   pathology - 2005 to 2010 14 sem   pathology - 2005 to 2010 1
4 sem pathology - 2005 to 2010 1Siam Weng Loong
 
Ppa6 lecture ch_13
Ppa6 lecture ch_13Ppa6 lecture ch_13
Ppa6 lecture ch_13Chris Auld
 
Electric charge and electric field
Electric charge and electric fieldElectric charge and electric field
Electric charge and electric fieldChris Auld
 
Presentati Sisteam Antrian Real-Time
Presentati Sisteam Antrian Real-TimePresentati Sisteam Antrian Real-Time
Presentati Sisteam Antrian Real-TimeUliel Azmie
 
Chapter 3 motion in two d 2
Chapter 3 motion in two d 2Chapter 3 motion in two d 2
Chapter 3 motion in two d 2Chris Auld
 
чил презентация
чил презентациячил презентация
чил презентацияDoltz
 
Presentasi Implementasi Algoritma ID3
Presentasi Implementasi Algoritma ID3Presentasi Implementasi Algoritma ID3
Presentasi Implementasi Algoritma ID3Uliel Azmie
 
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016IoT: from zero to hero for web developers - GDG DevFest Nantes 2016
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016Jan Jongboom
 
Building IoT devices for fun and profit - Mobile Era 2016
Building IoT devices for fun and profit - Mobile Era 2016Building IoT devices for fun and profit - Mobile Era 2016
Building IoT devices for fun and profit - Mobile Era 2016Jan Jongboom
 
Chapter 3 motion in two d
Chapter 3 motion in two dChapter 3 motion in two d
Chapter 3 motion in two dChris Auld
 
Chapter 15 thermodyanamic
Chapter 15 thermodyanamicChapter 15 thermodyanamic
Chapter 15 thermodyanamicChris Auld
 
Motion in one direction
Motion in one directionMotion in one direction
Motion in one directionChris Auld
 
Implementasi Metode AHP (Kasus : Smartphone)
Implementasi Metode AHP (Kasus : Smartphone)Implementasi Metode AHP (Kasus : Smartphone)
Implementasi Metode AHP (Kasus : Smartphone)Uliel Azmie
 
Electric charge and electric field
Electric charge and electric fieldElectric charge and electric field
Electric charge and electric fieldChris Auld
 
Run your JavaScript app for years on a coin cell - JSConf.asia 2016
Run your JavaScript app for years on a coin cell - JSConf.asia 2016Run your JavaScript app for years on a coin cell - JSConf.asia 2016
Run your JavaScript app for years on a coin cell - JSConf.asia 2016Jan Jongboom
 
Qué son los estilos de aprendizaje
Qué son los estilos de aprendizajeQué son los estilos de aprendizaje
Qué son los estilos de aprendizajejavier ramos moreno
 

Destaque (18)

Presentasi Message Confidentiality (Kerahasiaan Pesan)
Presentasi Message Confidentiality (Kerahasiaan Pesan)Presentasi Message Confidentiality (Kerahasiaan Pesan)
Presentasi Message Confidentiality (Kerahasiaan Pesan)
 
4 sem pathology - 2005 to 2010 1
4 sem   pathology - 2005 to 2010 14 sem   pathology - 2005 to 2010 1
4 sem pathology - 2005 to 2010 1
 
Ppa6 lecture ch_13
Ppa6 lecture ch_13Ppa6 lecture ch_13
Ppa6 lecture ch_13
 
Electric charge and electric field
Electric charge and electric fieldElectric charge and electric field
Electric charge and electric field
 
Presentati Sisteam Antrian Real-Time
Presentati Sisteam Antrian Real-TimePresentati Sisteam Antrian Real-Time
Presentati Sisteam Antrian Real-Time
 
Wikis (3)
Wikis (3)Wikis (3)
Wikis (3)
 
Chapter 3 motion in two d 2
Chapter 3 motion in two d 2Chapter 3 motion in two d 2
Chapter 3 motion in two d 2
 
чил презентация
чил презентациячил презентация
чил презентация
 
Presentasi Implementasi Algoritma ID3
Presentasi Implementasi Algoritma ID3Presentasi Implementasi Algoritma ID3
Presentasi Implementasi Algoritma ID3
 
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016IoT: from zero to hero for web developers - GDG DevFest Nantes 2016
IoT: from zero to hero for web developers - GDG DevFest Nantes 2016
 
Building IoT devices for fun and profit - Mobile Era 2016
Building IoT devices for fun and profit - Mobile Era 2016Building IoT devices for fun and profit - Mobile Era 2016
Building IoT devices for fun and profit - Mobile Era 2016
 
Chapter 3 motion in two d
Chapter 3 motion in two dChapter 3 motion in two d
Chapter 3 motion in two d
 
Chapter 15 thermodyanamic
Chapter 15 thermodyanamicChapter 15 thermodyanamic
Chapter 15 thermodyanamic
 
Motion in one direction
Motion in one directionMotion in one direction
Motion in one direction
 
Implementasi Metode AHP (Kasus : Smartphone)
Implementasi Metode AHP (Kasus : Smartphone)Implementasi Metode AHP (Kasus : Smartphone)
Implementasi Metode AHP (Kasus : Smartphone)
 
Electric charge and electric field
Electric charge and electric fieldElectric charge and electric field
Electric charge and electric field
 
Run your JavaScript app for years on a coin cell - JSConf.asia 2016
Run your JavaScript app for years on a coin cell - JSConf.asia 2016Run your JavaScript app for years on a coin cell - JSConf.asia 2016
Run your JavaScript app for years on a coin cell - JSConf.asia 2016
 
Qué son los estilos de aprendizaje
Qué son los estilos de aprendizajeQué son los estilos de aprendizaje
Qué son los estilos de aprendizaje
 

Semelhante a Performance and Scalability Tuning

4. (mjk) extreme performance 2
4. (mjk) extreme performance 24. (mjk) extreme performance 2
4. (mjk) extreme performance 2Doina Draganescu
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud applicationNoam Sheffer
 
Cloud Computing - Geektalk
Cloud Computing - GeektalkCloud Computing - Geektalk
Cloud Computing - GeektalkMalisa Ncube
 
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick ParkerDevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick ParkerR3
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18BIWUG
 
adap-stability-202310.pptx
adap-stability-202310.pptxadap-stability-202310.pptx
adap-stability-202310.pptxMichael Ming Lei
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applicationsAmit Kejriwal
 
Advanatages csc
Advanatages cscAdvanatages csc
Advanatages cscMDSHAMIM54
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesIvo Andreev
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesBhakti Mehta
 
NoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application EnablementNoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application EnablementDATAVERSITY
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that growGibraltar Software
 
Understanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyUnderstanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyKnoldus Inc.
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applicationsevilmike
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Brian Culver
 
Caching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' PerformanceCaching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' PerformanceRTigger
 

Semelhante a Performance and Scalability Tuning (20)

4. (mjk) extreme performance 2
4. (mjk) extreme performance 24. (mjk) extreme performance 2
4. (mjk) extreme performance 2
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud application
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Cloud Computing - Geektalk
Cloud Computing - GeektalkCloud Computing - Geektalk
Cloud Computing - Geektalk
 
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick ParkerDevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
 
Technical Architectures
Technical ArchitecturesTechnical Architectures
Technical Architectures
 
adap-stability-202310.pptx
adap-stability-202310.pptxadap-stability-202310.pptx
adap-stability-202310.pptx
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 
My Dissertation 2016
My Dissertation 2016My Dissertation 2016
My Dissertation 2016
 
Advanatages csc
Advanatages cscAdvanatages csc
Advanatages csc
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
 
NoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application EnablementNoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application Enablement
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
Understanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of EfficiencyUnderstanding System Design and Architecture Blueprints of Efficiency
Understanding System Design and Architecture Blueprints of Efficiency
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applications
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
 
Caching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' PerformanceCaching up is hard to do: Improving your Web Services' Performance
Caching up is hard to do: Improving your Web Services' Performance
 

Último

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Último (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Performance and Scalability Tuning

  • 1. Scalable Performance Building enterprise-scale web applications that perform
  • 2. Scalability vs. Performance • Ratio of the increase in • Serving a single request in the throughput to an increase in shortest amount of time resources • Inverse of latency • Support additional users at the least incremental cost • Predictability of application behavior as users are added
  • 3. Scalable Performance • Number of requests that can be concurrently served (throughput) while meeting a minimum level of service (response time) • Measuring: o Resource utilization o Throughput o Response time
  • 4. Horizontal vs. Vertical Scaling • Increase the hardware resources • Improve hardware capabilities • Separate types of processing into (cpu, RAM, storage, etc…) tiers • No network bottleneck • Commodity hardware is a • Becomes increasingly expensive predictable cost per user • Practical and financial limitations • Limitations to scaling are dictated to the ability to scale by application architecture • Typically increases performance • Can degrade performance
  • 6. General Observations • Performance decreases in each later tier (LB > web > app > DB) due to increasing complexity o Service requests in the earliest possible tier • Costs of scalability increases in each later tier (LB < web < app < DB) o Architect bottlenecks in the earliest possible tier • Scalable performance is ultimately limited by the operations that do not scale linearly • Ideally, each request that makes it to the database tier would have its own connection o Realistically, this means serving requests in earlier tiers because of constraints to db scaling
  • 8. Application Bottlenecks • Thread starvation • Thread contention • IO contention • IO performance • Memory limitations • Data access
  • 10. Resource Capacity Settings • Database CPUs • Database connection pool • Application server CPUs • Application server thread pool • JVM Heap settings • Web server thread pool
  • 11. Resource Capacity Settings • Walk through the application architecture and identify the points where a request could potentially wait. • Open all wait points. • Generate balanced and representative load against the environment. • Identify the limiting wait point’s saturation point. • Tighten all wait points to facilitate only the maximum load of the limiting wait point. • Force all pending requests to wait at the Web server. • Add more resources.
  • 12. Profiling • Long running http requests • Long running methods • Memory leaks • Deadlocks • Long running queries
  • 13. Database Tier • System of record • Difficult to scale horizontally and expensive to scale vertically • Keep connections limited to what the server will support o Block at the app tier • Perform data processing on staging server • Each database has its own optimization techniques o Explain plan to locate and eliminate full table scans o Query and table caches o Buffer sizes
  • 14. Application Tier • Generally cannot be stateless due to security and business requirements • Sticky vs. clustered sessions o Use the HTTPSession sparingly o If the app does not need to be HA, it may not require clean failover and can drop sessions • Scaling horizontally could potentially put more load on the DB o Caching can be used to offset the load
  • 15. Application Caching • Read-only data can be cached like static data in the web tier • Write-able data can be cached but will impose limitations on clustering o Will probably either need to be in-sync across the cluster or turned off completely • Filters can provide caching of dynamic, secure data at the earliest point in this tier o Caches entire response o Not recommended for user-specific data • Service layer or data access caches provide a simple way to stop requests from continuing to the database o Transparent to the calling code o Cache interceptors
  • 16. Tomcat Tuning • maxThreads controls actively served connections • backlog controls the number of connections that can be queued • maxThreads + backlog = total accepted connections • connectionTimeout can be used to drop faulty connections • bufferSize is by default set to -1, no buffering of output • Keep heap size manageable, < 2GB
  • 17. Web Tier • Clustering is easiest in the web tier because they are generally stateless • Web tier clustering can provide super-linear scaling (IO contention, context switching costs) • The web tier should serve all static data (images, static html) • The web tier can serve dynamic requests by caching non- secure data that only depends upon url parameters o Squid reverse proxy o Apache mod cache o Memcached
  • 18. Apache Tuning • Limit connections in the web tier to prevent overloading later tiers (MaxClients) • ServerLimit x Memory per process < RAM available to limit swapping • Avg connections = ThreadsPerChild x Apache hosts / App Server hosts • ProxyPass max = ThreadsPerChild
  • 19. Other • Grid Caches o GigaSpaces o Coherence • CDN o Akamai • Compute Appliances o Azul Systems
  • 20. References • http://www.theserverside.com/tt/articles/content/JIApresent ations/JIA-HASP.pdf • http://www.mnot.net/cache_docs/ • http://httpd.apache.org/docs/2.2/misc/perf-tuning.html • http://www.yourkit.com/overview/index.jsp • http://dev2dev.bea.com/pub/a/2006/05/declarative- caching.html • http://azulsystems.com/ • http://www.theserverside.com/tt/knowledgecenter/knowledg ecenter.tss?l=ProJavaEE_Ch06