SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Методология и практический опыт
тестирования быстродействия приложений,
сервисов и сайтов с высокой нагрузкой с
помощью Visual Studio 2012
Евгений Чигиринский Microsoft Corp.
Содержание
• Методологии тестирования
качества и нагрузки
– пробы и ошибки
• От методологии – к практике на
примере msn.com
– Visual Studio Profiler
– Тестирование нагрузки в условиях
автоматического управления датацентрами
– Тестирование быстродействия на
клиентской части
Why MSN?
• 19 лет online
• Траффик главной страницы (www.msn.com) – больше чем 4.3
миллиарда просмотров за месяц
• Постоянно в Top 20 сайтов мира
• Очень высокие требования к производительности сайта
• Присутствует во многих странах мира
– Порталы (www.msn.ru)
– Тематические сайты (http://cars.uk.msn.com/)
• What does High Quality mean?
• Resilience Quality
• Environment Quality
• Diagnostics & Monitoring Quality
• Configurability
• Maintainability
What does High Quality mean?
Quality is not just
working Functionality
Contributors to High Quality
Service Resilience Quality
Fault Tolerance
Recover from Fault conditions
Degrade Gracefully
How to Test? – Fault Injection!
“Chaos Monkey”
Handling Human Errors
Configuration Management
File & backup Management
Performance thresholds
If you don’t play well, we don’t play with you!
Throttling Capabilities
Dependency mapping
Avoids potential failures
Reduces Mitigation Time
Better Prediction of Impacts
Lowers Maintenance Risk and Increases Efficiency
“Design for failure and nothing will fail!”
“The best way to avoid failure is to fail constantly”
Software should protect humans from making mistakes
Environment Quality
• Test Environments in-sync with Production Environment
• Design For Roll back
• Solid Deployment testing in place
• Test Rollback mechanisms thoroughly
• Design for Human Error
• Quality Gates and Checks in place to prevent Corruption of Environment
• Configuration Changes should be treated like full fledged deployments
• Operational Excellence
• Mandatory Peer Reviews for Configuration changes & Script Executions
Diagnostics & Monitoring Quality
• Monitoring
 Being Proactive Vs. Reactive
 Lower MTTD [Mean Time to Detect]
 Lower Downtime & Higher Availability
 Add Monitoring Capability when you are building the service - not after!
 Monitoring Testing should be part of Test plan
 Plan for Multiple levels of Monitoring – Watch dogs, FTIP, etc
• Diagnostics
• Ability to collect required data
• More effective debugging and troubleshooting
• Lower time to restore
• How soon can we get the service back up and running
Maintainability
• The ease with which the system can be:
• Modified to meet new requirements
• Modified to make future maintenance easier
• Modified to correct defects
• Adapted to a changed environment
• Maintainability testing:
• Maintainability Index
• Cyclomatic Complexity
• Class Inheritance
• Class Coupling
• Lines of Code
Methodology
• Min Install
Component Level Testing
• Cluster Level Testing
Methodology : Minimal Installation
• One Box Setup
• Build the baseline (expectations)
• Tuning for scenarios
• See what comes from experiment (run)
Min Install - Performance Load and
Stress Testing
• Identify Production Scenarios (BVTs)
– Confirm meeting original expectations
– Define Baselines
• Identify Max Throughput
– Identify Bottlenecks (always start one to many)
– Identify Ceiling (how much work you can do with the system – can be memory, IO, CPU)
– Identify Capacity
– How it behaves beyond the limit
• Failure Scenarios (stress testing)
– Finding failure conditions, pushing the app to failure scenarios
– Examples:
• Too much traffic
• Too much memory/cache items
• Too many connections (resource starvation)
• Network IO/Disk IO
– Failing gracefully
• Endurance Testing
– Issues/Concerns happening over time (usually over 72 hours) – Leaks, Disk space, Timed events
Methodology : Cluster Level Testing
• Integration Testing
• Prod simulation (IIS Playback, SQL playback, etc)
• Testing new behavior for new features
• Failing gracefully
• Load Test In Production (LTIP)
Performance is important
• How to improve it?
– Measure
– Fix
– Measure again
• How to measure it with VS?
– VS Profiler
What is VS Profiler?
• Performance measurement tool
• Process oriented
Ultimate Premium Professional Express
Common Performance Issue
• High CPU utilization
• I/O bottleneck
• Tiers interaction
• Resource contention, Poor core utilization
• Memory issues
High CPU utilization
• Sampling: statistical form of CPU profiling
• Choose Sampling when
– CPU is the critical resource
– Low overhead is required
• Non-intrusive
• Samples != Time
Sampling Profiling
• void Alpha()
• {
•
• Beta();
• }
• void Beta()
• {
• }
30 samples
50 samples
Exclusive Inclusive
Alpha
Beta 50 50
30 80
Sampling Profiling Call Tree
Q&A
I/O bottleneck
• Instrumentation: method timing profiling
• Choose Instrumentation when
– CPU usage is low
– Exact function call counts are necessary
– Exact timing is necessary
• Higher overhead
• Intrusive
Instrumentation Profiling
• void MyFunction()
• {
• FUNC_ENTER(MyFunction);
• . . .
• CALL_ENTER(WriteFile);
• // Call another function
• WriteFile(...);
• CALL_EXIT(WriteFile);
• . . .
• FUNC_EXIT(MyFunction);
• }
Elapsed Time
Application
Time
Application
Time
Instrumentation Profiling Call Tree
Managed memory profiling
• Allocation data
– Allocated type
– Allocating call stack
• Lifetime data
– GC generations
More power to VS Profiler
• Data collection
– Remote profiling
– ETW based collection
– Various performance counters
– Command line tools
– APIs
Multiproc collection
Standalone profiler
Collect what you need
Attach/Detach, Pause/Resume
VS Profiler - Limitations
• Move to ETW in Visual Studio 2012
• Windows 8 Limitations with CPU sampling
– Tier Interaction Profiling data cannot be collected
– The “Sampling” performance session cannot be configured
– Windows performance counters cannot be collected while CPU sampling
– NGEN-ed methods will not show real method names
Тестирование нагрузки в условиях автоматического
управления датацентрами
Automatic DC Management
• Like a cloud, but with more control
• Testing the deployment process
• Monitoring
Monitoring
• Deployment monitoring
– Automated rollbacks
• Watchdogs
– Simple Watchdogs (disk space, CPU, etc)
– User Watchdogs
• service that monitors the production service
– Set machine properties with centralized service
• Alerts
– Actions based on machine properties set by watchdog
Тестирование быстродействия на
клиентской части
Что будет рассмотрено
TTI
PLT
TTV
PLT2
TTG
TTLB
TTO
TTFR
TTFB
VRTA
MSN
PIE
Keynote
YSlow
WebPageTest
Gomez
WebRunner
Что это за метрики?
Как измерять
производительность?
Что можно сделать?
Метрики для оценки производительности
Запрос
страницы
Сервер посылает
HTML браузеру
Браузер парсирует
HTML, загружает JS и
CSS, строит DOM,
запрашивает
изображения.
Отображение
первого
видимого
элемента
Отображение
видимой
страницы
Загрузка последнего
видимого элемента
страницы
(чаще всего за экраном)
Вся ресурсы
страницы
загружены.
Browser fires
on-load event
Beacons
are fired
Прием
последнего
байта
страницы.
Производительность
«сервера»
TTLB
Time to
last byte
TTFB
Time to
first byte
TTFR
Time to
first render
TTV
Time to
last visual
TTO
Time to
OnLoad
TAFR
Above fold
render
Page Load Time - PLT
perceived approximated
Какие метрики производительности
нужно использовать?
TTLB
Time to
last byte
TTFB
Time to
first byte
TTFR
Time to
first render
TTV
Time to
last visual
TTO
Time to
OnLoad
TAFR
Above fold
render
Perceived Approximated
Performance Optimizations
• Images loaded optimally in phases
• Async script loading
• JS execution in multiple phases
• Testing on real mobile devices
• Optimized ad loading
• Other optimizations
Optimal Image Loading
Define and maintain Performance budget
– PLT goal permits only 400KB weight at 100% bandwidth efficiency (less in
practice)
Responsive design
– Need to load different images based on view mode (e.g. Snap view);
determined client-side
– Load images in phases
CPU Analysis Methodology
• Capture event traces (ETW) on the device
• Use XPerf trace analysis tool to visualize CPU cost across IE subsystems
– JavaScript, CSS, Formatting, Layout, Display etc.
• Identify bottlenecks and JS code paths responsible for them
Example: Jerky TOC Snapping
Situation
• TOC snapping animation is jerky (12fps on Surface RT)
Opportunity
• Cycle of measuring and updating CSS position of TOC as user
scrolls down results in costly recalculation of entire layout tree with
every loop iteration
• 80ms CPU time for each cycle results in jerky animation
Goal: Ads do not block Onload
• Onload has impact on perceived performance, such as the ‘Done’ indicator
• Onload is used to trigger secondary functionality
Example: Optimized Ad Load
Onload Ad request blocks Onload
Solution:
• Modify ads handling code to avoid blocking of Onload
Onload Ad request does not block Onload
Key Findings for MSN
• Define and maintain perf budgets
• Test as near to Prod as possible
• Know your dependencies
– Avoid 3rd party libraries that are not designed with performance in mind
• Make sure that your sample data is valid
• Monitoring is the key
• Visual Studio Profiler helps finding issues quickly!
References
• Visual Studio ALM + Team Foundation Server Blog
http://blogs.msdn.com/b/visualstudioalm/
• Profiling Windows 8 and Windows Server 2012 applications
http://msdn.microsoft.com/en-us/library/hh974575.aspx
• Configuring the profiler as part of your load testing in Visual Studio
http://msdn.microsoft.com/en-us/library/dd504817.aspx
• Load Testing in Visual Studio 2012
http://blogs.msdn.com/b/visualstudioalm/archive/2012/06/04/getting-started-with-load-testing-in-visual-studio-
2012.aspx
• VS Profiler – CPU Sampling
http://blogs.msdn.com/b/visualstudioalm/archive/2013/02/27/how-to-profile-a-xaml-windows-store-app.aspx
• Profiling .NET Memory Allocation
http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio-
2012.aspx
Q&A

Weitere ähnliche Inhalte

Andere mochten auch

Роли, в которые играют тестировщики
Роли, в которые играют тестировщикиРоли, в которые играют тестировщики
Роли, в которые играют тестировщикиSQALab
 
Развитие в тестировании: включаем реактивный двигатель!
Развитие в тестировании: включаем реактивный двигатель!Развитие в тестировании: включаем реактивный двигатель!
Развитие в тестировании: включаем реактивный двигатель!SQALab
 
User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?SQALab
 
Тестирование производительности клиентсайда
Тестирование производительности клиентсайдаТестирование производительности клиентсайда
Тестирование производительности клиентсайдаSQALab
 
Тестирование спецификаций
Тестирование спецификацийТестирование спецификаций
Тестирование спецификацийSQALab
 
Аналитик и Тестировщик в одном лице – путь к качеству
Аналитик и Тестировщик в одном лице – путь к качествуАналитик и Тестировщик в одном лице – путь к качеству
Аналитик и Тестировщик в одном лице – путь к качествуSQALab
 
Impact Analysis в тестировании
Impact Analysis в тестированииImpact Analysis в тестировании
Impact Analysis в тестированииSQALab
 
Нагрузочное тестирование web проектов
Нагрузочное тестирование web проектовНагрузочное тестирование web проектов
Нагрузочное тестирование web проектовSQALab
 
Шаблоны проектирования письменной коммуникации
Шаблоны проектирования письменной коммуникацииШаблоны проектирования письменной коммуникации
Шаблоны проектирования письменной коммуникацииSQALab
 
Сложности и практики тестирования производительности
Сложности и практики тестирования производительностиСложности и практики тестирования производительности
Сложности и практики тестирования производительностиSQALab
 

Andere mochten auch (10)

Роли, в которые играют тестировщики
Роли, в которые играют тестировщикиРоли, в которые играют тестировщики
Роли, в которые играют тестировщики
 
Развитие в тестировании: включаем реактивный двигатель!
Развитие в тестировании: включаем реактивный двигатель!Развитие в тестировании: включаем реактивный двигатель!
Развитие в тестировании: включаем реактивный двигатель!
 
User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?User Interface Тестирование – все ли так просто?
User Interface Тестирование – все ли так просто?
 
Тестирование производительности клиентсайда
Тестирование производительности клиентсайдаТестирование производительности клиентсайда
Тестирование производительности клиентсайда
 
Тестирование спецификаций
Тестирование спецификацийТестирование спецификаций
Тестирование спецификаций
 
Аналитик и Тестировщик в одном лице – путь к качеству
Аналитик и Тестировщик в одном лице – путь к качествуАналитик и Тестировщик в одном лице – путь к качеству
Аналитик и Тестировщик в одном лице – путь к качеству
 
Impact Analysis в тестировании
Impact Analysis в тестированииImpact Analysis в тестировании
Impact Analysis в тестировании
 
Нагрузочное тестирование web проектов
Нагрузочное тестирование web проектовНагрузочное тестирование web проектов
Нагрузочное тестирование web проектов
 
Шаблоны проектирования письменной коммуникации
Шаблоны проектирования письменной коммуникацииШаблоны проектирования письменной коммуникации
Шаблоны проектирования письменной коммуникации
 
Сложности и практики тестирования производительности
Сложности и практики тестирования производительностиСложности и практики тестирования производительности
Сложности и практики тестирования производительности
 

Mehr von SQALab

Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировкуSQALab
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаSQALab
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиSQALab
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияSQALab
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...SQALab
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testingSQALab
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженSQALab
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииSQALab
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовSQALab
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовSQALab
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsSQALab
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеSQALab
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииSQALab
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеSQALab
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестированиеSQALab
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"SQALab
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовSQALab
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных системSQALab
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросSQALab
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...SQALab
 

Mehr von SQALab (20)

Готовим стажировку
Готовим стажировкуГотовим стажировку
Готовим стажировку
 
Куда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщикаКуда приводят мечты? или Искусство развития тестировщика
Куда приводят мечты? или Искусство развития тестировщика
 
Оптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержкиОптимизация Selenium тестов и ускорение их поддержки
Оптимизация Selenium тестов и ускорение их поддержки
 
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программированияАвтоматизация 0.0: 0 - бюджет, 0 - опыт программирования
Автоматизация 0.0: 0 - бюджет, 0 - опыт программирования
 
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
Нагрузочное тестирование нестандартных протоколов с использованием Citrix и J...
 
Continuous performance testing
Continuous performance testingContinuous performance testing
Continuous performance testing
 
Конфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нуженКонфиги вместо костылей. Pytestconfig и зачем он нужен
Конфиги вместо костылей. Pytestconfig и зачем он нужен
 
Команда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихииКоманда чемпионов в ИТ стихии
Команда чемпионов в ИТ стихии
 
API. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советовAPI. Серебряная пуля в магазине советов
API. Серебряная пуля в магазине советов
 
Добиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестовДобиваемся эффективности каждого из 9000+ UI-тестов
Добиваемся эффективности каждого из 9000+ UI-тестов
 
Делаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIsДелаем автоматизацию проектных KPIs
Делаем автоматизацию проектных KPIs
 
Вредные привычки в тест-менеджменте
Вредные привычки в тест-менеджментеВредные привычки в тест-менеджменте
Вредные привычки в тест-менеджменте
 
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизацииМощь переполняет с JDI 2.0 - новая эра UI автоматизации
Мощь переполняет с JDI 2.0 - новая эра UI автоматизации
 
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качествеКак hh.ru дошли до 500 релизов в квартал без потери в качестве
Как hh.ru дошли до 500 релизов в квартал без потери в качестве
 
Стили лидерства и тестирование
Стили лидерства и тестированиеСтили лидерства и тестирование
Стили лидерства и тестирование
 
"Давайте не будем про качество"
"Давайте не будем про качество""Давайте не будем про качество"
"Давайте не будем про качество"
 
Apache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектовApache.JMeter для .NET-проектов
Apache.JMeter для .NET-проектов
 
Тестирование геолокационных систем
Тестирование геолокационных системТестирование геолокационных систем
Тестирование геолокационных систем
 
Лидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопросЛидер или босс? Вот в чем вопрос
Лидер или босс? Вот в чем вопрос
 
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
От Зефира в коробке к Structure Zephyr или как тест-менеджеру перекроить внут...
 

Kürzlich hochgeladen

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 

Kürzlich hochgeladen (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

Методология и практический опыт тестирования быстродействия приложений, сервисов и сайтов с высокой нагрузкой с помощью Visual Studio 2012

  • 1. Методология и практический опыт тестирования быстродействия приложений, сервисов и сайтов с высокой нагрузкой с помощью Visual Studio 2012 Евгений Чигиринский Microsoft Corp.
  • 2. Содержание • Методологии тестирования качества и нагрузки – пробы и ошибки • От методологии – к практике на примере msn.com – Visual Studio Profiler – Тестирование нагрузки в условиях автоматического управления датацентрами – Тестирование быстродействия на клиентской части
  • 3. Why MSN? • 19 лет online • Траффик главной страницы (www.msn.com) – больше чем 4.3 миллиарда просмотров за месяц • Постоянно в Top 20 сайтов мира • Очень высокие требования к производительности сайта • Присутствует во многих странах мира – Порталы (www.msn.ru) – Тематические сайты (http://cars.uk.msn.com/)
  • 4.
  • 5. • What does High Quality mean? • Resilience Quality • Environment Quality • Diagnostics & Monitoring Quality • Configurability • Maintainability
  • 6. What does High Quality mean? Quality is not just working Functionality Contributors to High Quality
  • 7. Service Resilience Quality Fault Tolerance Recover from Fault conditions Degrade Gracefully How to Test? – Fault Injection! “Chaos Monkey” Handling Human Errors Configuration Management File & backup Management Performance thresholds If you don’t play well, we don’t play with you! Throttling Capabilities Dependency mapping Avoids potential failures Reduces Mitigation Time Better Prediction of Impacts Lowers Maintenance Risk and Increases Efficiency “Design for failure and nothing will fail!” “The best way to avoid failure is to fail constantly” Software should protect humans from making mistakes
  • 8. Environment Quality • Test Environments in-sync with Production Environment • Design For Roll back • Solid Deployment testing in place • Test Rollback mechanisms thoroughly • Design for Human Error • Quality Gates and Checks in place to prevent Corruption of Environment • Configuration Changes should be treated like full fledged deployments • Operational Excellence • Mandatory Peer Reviews for Configuration changes & Script Executions
  • 9. Diagnostics & Monitoring Quality • Monitoring  Being Proactive Vs. Reactive  Lower MTTD [Mean Time to Detect]  Lower Downtime & Higher Availability  Add Monitoring Capability when you are building the service - not after!  Monitoring Testing should be part of Test plan  Plan for Multiple levels of Monitoring – Watch dogs, FTIP, etc • Diagnostics • Ability to collect required data • More effective debugging and troubleshooting • Lower time to restore • How soon can we get the service back up and running
  • 10. Maintainability • The ease with which the system can be: • Modified to meet new requirements • Modified to make future maintenance easier • Modified to correct defects • Adapted to a changed environment • Maintainability testing: • Maintainability Index • Cyclomatic Complexity • Class Inheritance • Class Coupling • Lines of Code
  • 11. Methodology • Min Install Component Level Testing • Cluster Level Testing
  • 12. Methodology : Minimal Installation • One Box Setup • Build the baseline (expectations) • Tuning for scenarios • See what comes from experiment (run)
  • 13. Min Install - Performance Load and Stress Testing • Identify Production Scenarios (BVTs) – Confirm meeting original expectations – Define Baselines • Identify Max Throughput – Identify Bottlenecks (always start one to many) – Identify Ceiling (how much work you can do with the system – can be memory, IO, CPU) – Identify Capacity – How it behaves beyond the limit • Failure Scenarios (stress testing) – Finding failure conditions, pushing the app to failure scenarios – Examples: • Too much traffic • Too much memory/cache items • Too many connections (resource starvation) • Network IO/Disk IO – Failing gracefully • Endurance Testing – Issues/Concerns happening over time (usually over 72 hours) – Leaks, Disk space, Timed events
  • 14. Methodology : Cluster Level Testing • Integration Testing • Prod simulation (IIS Playback, SQL playback, etc) • Testing new behavior for new features • Failing gracefully • Load Test In Production (LTIP)
  • 15. Performance is important • How to improve it? – Measure – Fix – Measure again • How to measure it with VS? – VS Profiler
  • 16. What is VS Profiler? • Performance measurement tool • Process oriented Ultimate Premium Professional Express
  • 17. Common Performance Issue • High CPU utilization • I/O bottleneck • Tiers interaction • Resource contention, Poor core utilization • Memory issues
  • 18. High CPU utilization • Sampling: statistical form of CPU profiling • Choose Sampling when – CPU is the critical resource – Low overhead is required • Non-intrusive • Samples != Time
  • 19. Sampling Profiling • void Alpha() • { • • Beta(); • } • void Beta() • { • } 30 samples 50 samples Exclusive Inclusive Alpha Beta 50 50 30 80
  • 21. Q&A
  • 22. I/O bottleneck • Instrumentation: method timing profiling • Choose Instrumentation when – CPU usage is low – Exact function call counts are necessary – Exact timing is necessary • Higher overhead • Intrusive
  • 23. Instrumentation Profiling • void MyFunction() • { • FUNC_ENTER(MyFunction); • . . . • CALL_ENTER(WriteFile); • // Call another function • WriteFile(...); • CALL_EXIT(WriteFile); • . . . • FUNC_EXIT(MyFunction); • } Elapsed Time Application Time Application Time
  • 25. Managed memory profiling • Allocation data – Allocated type – Allocating call stack • Lifetime data – GC generations
  • 26. More power to VS Profiler • Data collection – Remote profiling – ETW based collection – Various performance counters – Command line tools – APIs Multiproc collection Standalone profiler Collect what you need Attach/Detach, Pause/Resume
  • 27. VS Profiler - Limitations • Move to ETW in Visual Studio 2012 • Windows 8 Limitations with CPU sampling – Tier Interaction Profiling data cannot be collected – The “Sampling” performance session cannot be configured – Windows performance counters cannot be collected while CPU sampling – NGEN-ed methods will not show real method names
  • 28. Тестирование нагрузки в условиях автоматического управления датацентрами
  • 29. Automatic DC Management • Like a cloud, but with more control • Testing the deployment process • Monitoring
  • 30. Monitoring • Deployment monitoring – Automated rollbacks • Watchdogs – Simple Watchdogs (disk space, CPU, etc) – User Watchdogs • service that monitors the production service – Set machine properties with centralized service • Alerts – Actions based on machine properties set by watchdog
  • 32. Что будет рассмотрено TTI PLT TTV PLT2 TTG TTLB TTO TTFR TTFB VRTA MSN PIE Keynote YSlow WebPageTest Gomez WebRunner Что это за метрики? Как измерять производительность? Что можно сделать?
  • 33. Метрики для оценки производительности Запрос страницы Сервер посылает HTML браузеру Браузер парсирует HTML, загружает JS и CSS, строит DOM, запрашивает изображения. Отображение первого видимого элемента Отображение видимой страницы Загрузка последнего видимого элемента страницы (чаще всего за экраном) Вся ресурсы страницы загружены. Browser fires on-load event Beacons are fired Прием последнего байта страницы. Производительность «сервера» TTLB Time to last byte TTFB Time to first byte TTFR Time to first render TTV Time to last visual TTO Time to OnLoad TAFR Above fold render Page Load Time - PLT perceived approximated
  • 34. Какие метрики производительности нужно использовать? TTLB Time to last byte TTFB Time to first byte TTFR Time to first render TTV Time to last visual TTO Time to OnLoad TAFR Above fold render Perceived Approximated
  • 35. Performance Optimizations • Images loaded optimally in phases • Async script loading • JS execution in multiple phases • Testing on real mobile devices • Optimized ad loading • Other optimizations
  • 36. Optimal Image Loading Define and maintain Performance budget – PLT goal permits only 400KB weight at 100% bandwidth efficiency (less in practice) Responsive design – Need to load different images based on view mode (e.g. Snap view); determined client-side – Load images in phases
  • 37. CPU Analysis Methodology • Capture event traces (ETW) on the device • Use XPerf trace analysis tool to visualize CPU cost across IE subsystems – JavaScript, CSS, Formatting, Layout, Display etc. • Identify bottlenecks and JS code paths responsible for them
  • 38. Example: Jerky TOC Snapping Situation • TOC snapping animation is jerky (12fps on Surface RT) Opportunity • Cycle of measuring and updating CSS position of TOC as user scrolls down results in costly recalculation of entire layout tree with every loop iteration • 80ms CPU time for each cycle results in jerky animation
  • 39. Goal: Ads do not block Onload • Onload has impact on perceived performance, such as the ‘Done’ indicator • Onload is used to trigger secondary functionality Example: Optimized Ad Load Onload Ad request blocks Onload Solution: • Modify ads handling code to avoid blocking of Onload Onload Ad request does not block Onload
  • 40. Key Findings for MSN • Define and maintain perf budgets • Test as near to Prod as possible • Know your dependencies – Avoid 3rd party libraries that are not designed with performance in mind • Make sure that your sample data is valid • Monitoring is the key • Visual Studio Profiler helps finding issues quickly!
  • 41. References • Visual Studio ALM + Team Foundation Server Blog http://blogs.msdn.com/b/visualstudioalm/ • Profiling Windows 8 and Windows Server 2012 applications http://msdn.microsoft.com/en-us/library/hh974575.aspx • Configuring the profiler as part of your load testing in Visual Studio http://msdn.microsoft.com/en-us/library/dd504817.aspx • Load Testing in Visual Studio 2012 http://blogs.msdn.com/b/visualstudioalm/archive/2012/06/04/getting-started-with-load-testing-in-visual-studio- 2012.aspx • VS Profiler – CPU Sampling http://blogs.msdn.com/b/visualstudioalm/archive/2013/02/27/how-to-profile-a-xaml-windows-store-app.aspx • Profiling .NET Memory Allocation http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio- 2012.aspx
  • 42. Q&A

Hinweis der Redaktion

  1. We cannot get a good stress/load testing against the cluster. Always start from one box. If you start from the cluster, you will have to take the network noise into account, etc.
  2. Idea: perf load and stress testing as in physics lab: build the baseline (expectations), then tuning (what happens with several scenarios), then what came from the experiment (run). In other words, it is a controlled evaluation of different condition and different expectations.Baselines: hypotetic for new features, revised for improved featuresEndurance Testing:Issues/Concerns happening over time (at least 72 hours)Leaks (memory, threads, handles, resource leaks)Disk space (logs)Timed events
  3. CPU usage is low is because: blocking is an issue (I/O, locks, context switches)
  4. Mention that Instrumentation can be static (VSInstr.exe) or Dynamic (JavaScript, TIP, Detours)
  5. CPU usage is low is because: blocking is an issue (I/O, locks, sontext switches)
  6. Original VS profiler driver was written to utilize Windows undocumented features and interfere with kernel during collection of samples. VS 2012 went to ETW (Event Tracing for Windows), but VS profiling tooling was not moved to it yet. In Windows 8/2012 the security was enhanced, so kernel interferences are not working anymore. The team is working on the new driver.
  7. Xperf is part of the Microsoft Windows Performance Toolkit (WPT for short) which includes several other software development tools.
  8. Example: Unity