SlideShare a Scribd company logo
MULTITHREADING AND
SCALING: Diary of a
Madman #0000
TSIMAFEI AVILIN
FEBRUARY 26, 2017
Maslenitsa Co.
FEBRUARY 26, 2017
API TESTING+ PRE-LOAD TESTING + AZURE
MULTITHREADING AND
SCALING: Diary of a
Madman #0000
3CONFIDENTIAL
AGENDA
What we want to share:
• PROBLEM STATEMENT
• MULTI THREADING AS A PRE-LOAD TESTING
• SCALING IN AZURE
4CONFIDENTIAL
PROBLEM STATEMENT
Maslenitsa is being celebrated today and you
have to bake 1000 pancakes in a short time,
how you gonna do that?
5CONFIDENTIAL
STEP BY STEP SOLUTIONS
bake 1000 pancakes for one cook – tooooo long!
bake 1000 pancakes for a group of
cooks – much better!
+ Good approach!
6CONFIDENTIAL
PROBLEM STATEMENT
Imagine that you need to perform comparison of
many thousands of items in most cases of the
same type (files, DB data, strings, etc. )
7CONFIDENTIAL
OUR ARCHITECTURE  TASK
Need to compare thousands of .xml files in a short time…
Responses are coming from REST and SOAP services
FilestobecomparedinSOAPandRESTservices
8CONFIDENTIAL
ONE THREAD, LAPTOP, 1000 files
Example of a simple method to compare API responses from REST and SOAP services
var comparisionResult = Comparison.Run(validatedUBFContext.FromSOAP,
validatedUBFContext.FromREST);
Laptop processor:
• Processor: Intel® Core™ i5-6300U
• # Cores: 2
• # Threads : 4
Time to process 1000 files (each file is about 50-100Kb size of):
• 31.30min
9CONFIDENTIAL
MUTLITHREADING, SAME LAPTOP, 1000 files
MaxDegreeOfParallelism – number of threads
var opt = new ParallelOptions { MaxDegreeOfParallelism =
int.Parse(ConfigurationManager.AppSettings["DegreeOfParallelization"]) };
Parallel.ForEach(validatedUBFProvider.GetUBFs(ubfStoragePath, opt, validatedUBFContext =>
{try
{var comparisionResult = Comparison.Run(validatedUBFContext.SOAP, validatedUBFContext.REST); } }
Degree
Time,
min
1 31.34
4 10.05
5 8.49
7 8.19
8 7.24
9 6.53
10 6.44
30 6
50 6.22
70 6.56
100 6.35
150 6.14
200 7
0
5
10
15
20
25
30
35
0 20 40 60 80 100 120
Time/Degree
Time to process 1000 files is about 6.30 min instead of 31.30min
10CONFIDENTIAL
MULTITHREADING AS PRE-LOAD TESTING
Even performing this simple testing based on multithreading and sending API requests
(.xml files ~ 60.000 files per day ) to both REST and SOAP services, brought out some
issues:
• DB issues (DB architecture, indexing, procedures, etc.)
• API issues (500 internal server error as internal api issues, scaling, etc.)
• APP CONFIGURATION issues (no specific configuration file, code regression issues, needs
of additional system specific activities like restart IIS which is an issue, etc.)
• Indicating of a maximum request size as a system confines
• Caching issues
• etc.
11CONFIDENTIAL
FEBRUARY 26, 2017
GO FORWARD AND USE
AZURE PRICES PLANS
12CONFIDENTIAL
SCALING IN AZURE : DB (DTU)
Database Throughput Unit (DTU): DTUs provide a way to describe the relative capacity of a
performance level. DTUs are based on a blended measure of CPU, memory, reads, and writes. As
DTUs increase, the power offered by the performance level increases.
13CONFIDENTIAL
SCALING IN AZURE : APP SERVICE
14CONFIDENTIAL
MUTLITHREADING, SAME LAPTOP, 1000 files,
scaling in Azure
Because of files to be validatedverifying are processed on VM in Azure (DB + SOAP) on the one
hand and REST service on another one, we can try to play with pricing plans to make better
performance of DB and a instance where service is running.
DTU S2 S0 S0 S0 S1 S3 P1 P2 P2
APP SERVICE S2 S2 S1 S3 S2 S2 S2 S2 P3
Number of threads:10/ min 6.14 6.59 6.49 7.08 6.56 7.01 7.06 6.5 6.57
As it can be seen from the table above, it does not make sense to pay much money for the
more expensive prices plans.
It’s obvious, because laptop cannot send more requests then the processor allows based on
proposed architecture and ‘infrastructure’.
15CONFIDENTIAL
MUTLITHREADING, SERVER, 1000 files, scaling
in Azure
Server processor:
• Processor: Intel(R) Xeon(R) CPU E5-2670 0 2.60GHz
• # Cores: 8
• # Threads : 16
Time to process 1000 files (each file is about 50-100Kb size of) with 100
threads:
• 4.30min
Threads DTU
APP
SERVICE start end dif
100P2 S3 2:49:54 2:54:36 0:04:42
100P1 S3 3:06:25 3:10:49 0:04:24
100S3 S3 3:24:00 3:28:37 0:04:37
100S0 S3 3:58:50 4:04:34 0:05:44
100P2 S1 5:07:30 5:12:27 0:04:57
Scaling in Azure:
S0S3 vs S3S3- the difference is only ~1 min, but in case of 20K files it would be
about 20min
16CONFIDENTIAL
FEBRUARY 26, 2017
THANKS! ДЗЯКУЮ! СПАСИБО!

More Related Content

PDF
10 EZ Steps to SOLR Domination - Berlin Buzzwords 2012
PPTX
How to migrate your existing MongoDB and Cassandra Apps to Azure Cosmos DB
PDF
LocalSocial, Dial2Do and the Cloud
PDF
Functional Programming in Serverless World
PPTX
Introduction to NodeJS
PPTX
Amazon web services
PDF
David Fetter, Disqus
PDF
Couchbase Usecase : Mobile Game Cookierun
10 EZ Steps to SOLR Domination - Berlin Buzzwords 2012
How to migrate your existing MongoDB and Cassandra Apps to Azure Cosmos DB
LocalSocial, Dial2Do and the Cloud
Functional Programming in Serverless World
Introduction to NodeJS
Amazon web services
David Fetter, Disqus
Couchbase Usecase : Mobile Game Cookierun

Viewers also liked (20)

PDF
Некоторые физические законы в контексте автоматизации тестирования
PPTX
Автоматизация тестирования API для начинающих
PPTX
Логические инструменты в арсенале тестировщика
PPT
Процесс тестирования в условиях неявных требований
PPTX
Career boost: как джуниору случайно стать лидом и не получить от этого удовол...
PPTX
тестовые стратегии
PPTX
Future of UI Automation testing and JDI
PPTX
В топку Postman - пишем API автотесты в привычном стеке
PDF
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
PPTX
Refresh your project vision with Report Portal
PPTX
Business requirements analysis during Production release
PPS
Google apps для бизнеса
PDF
Heuristics, mnemonics and other Greek words in the exploratory testing of mob...
PPTX
Google Apps Script: The Authentic{ated} Playground
PPTX
Вадим Зубович - Sikuli script - идеальный инструмент для обучения автоматизации
PPSX
Trishweb
PPTX
2 tema 4 estructuras organizativas del centro escolar-1
PPTX
Allure framework. Пример настройки исчерпывающего репорта на реальном проекте
PPT
презентация савилова
PPT
доклад электромагнитное излучение
Некоторые физические законы в контексте автоматизации тестирования
Автоматизация тестирования API для начинающих
Логические инструменты в арсенале тестировщика
Процесс тестирования в условиях неявных требований
Career boost: как джуниору случайно стать лидом и не получить от этого удовол...
тестовые стратегии
Future of UI Automation testing and JDI
В топку Postman - пишем API автотесты в привычном стеке
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
Refresh your project vision with Report Portal
Business requirements analysis during Production release
Google apps для бизнеса
Heuristics, mnemonics and other Greek words in the exploratory testing of mob...
Google Apps Script: The Authentic{ated} Playground
Вадим Зубович - Sikuli script - идеальный инструмент для обучения автоматизации
Trishweb
2 tema 4 estructuras organizativas del centro escolar-1
Allure framework. Пример настройки исчерпывающего репорта на реальном проекте
презентация савилова
доклад электромагнитное излучение
Ad

Similar to А давайте будем многопоточить и масштабировить! - записки сумасшедшего №0 (20)

PPTX
Building Scalable Applications with Microsoft Azure
PDF
Scaling apps using azure cloud services
PDF
Azure Cloud Dev Camp - App Platform
PPTX
Architecture et coût
PDF
Building Real World Application with Azure
PPTX
Inside Microsoft Azure
PPTX
A Lap Around Azure
PPTX
Scaling Cloud Apps
PPTX
Windows azure overview for SharePoint Pros
PPTX
Microsoft Azure Web Sites Performance Analysis Lessons Learned
PPTX
Windows Azure Acid Test
PPTX
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
PPTX
All about Azure workshop deck
PDF
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
PPTX
Azure App Service Deep Dive
PPTX
Put Your Existing Application On Windows Azure
PPTX
Running in the Cloud - First Belgian Azure project
PPTX
Running in the Cloud - First Belgian Azure project
PPTX
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
PPTX
Innovations of .NET and Azure (Recaps of Build 2017 selected sessions)
Building Scalable Applications with Microsoft Azure
Scaling apps using azure cloud services
Azure Cloud Dev Camp - App Platform
Architecture et coût
Building Real World Application with Azure
Inside Microsoft Azure
A Lap Around Azure
Scaling Cloud Apps
Windows azure overview for SharePoint Pros
Microsoft Azure Web Sites Performance Analysis Lessons Learned
Windows Azure Acid Test
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
All about Azure workshop deck
Escalabilidad horizontal y arquitecturas elásticas en Microsoft azure
Azure App Service Deep Dive
Put Your Existing Application On Windows Azure
Running in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
Innovations of .NET and Azure (Recaps of Build 2017 selected sessions)
Ad

More from COMAQA.BY (20)

PDF
Тестирование аналогов инсталлируемых приложений (Android Instant Apps, Progre...
PPTX
Anton semenchenko. Comaqa Spring 2018. Nine circles of hell. Antipatterns in ...
PPTX
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
PPTX
Roman Soroka. Comaqa Spring 2018. Глобальный обзор процесса QA и его важность
PPTX
Roman Iovlev. Comaqa Spring 2018. Архитектура Open Source решений для автомат...
PPTX
Vladimir Polyakov. Comaqa Spring 2018. Особенности тестирования ПО в предметн...
PPTX
Kimmo Hakala. Comaqa Spring 2018. Challenges and good QA practices in softwar...
PPTX
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
PPTX
Ivan Katunov. Comaqa Spring 2018. Test Design and Automation for Rest API.
PPTX
Vadim Zubovich. Comaqa Spring 2018. Красивое тестирование производительности.
PPTX
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
PPTX
Моя роль в конфликте
PPTX
Организация приемочного тестирования силами матерых тестировщиков
PPTX
Развитие или смерть
PPTX
Системный взгляд на параллельный запуск Selenium тестов
PPTX
Эффективная работа с рутинными задачами
PPTX
Как стать синьором
PPTX
Open your mind for OpenSource
PPTX
JDI 2.0. Not only UI testing
PPTX
Out of box page object design pattern, java
Тестирование аналогов инсталлируемых приложений (Android Instant Apps, Progre...
Anton semenchenko. Comaqa Spring 2018. Nine circles of hell. Antipatterns in ...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Roman Soroka. Comaqa Spring 2018. Глобальный обзор процесса QA и его важность
Roman Iovlev. Comaqa Spring 2018. Архитектура Open Source решений для автомат...
Vladimir Polyakov. Comaqa Spring 2018. Особенности тестирования ПО в предметн...
Kimmo Hakala. Comaqa Spring 2018. Challenges and good QA practices in softwar...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Ivan Katunov. Comaqa Spring 2018. Test Design and Automation for Rest API.
Vadim Zubovich. Comaqa Spring 2018. Красивое тестирование производительности.
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Моя роль в конфликте
Организация приемочного тестирования силами матерых тестировщиков
Развитие или смерть
Системный взгляд на параллельный запуск Selenium тестов
Эффективная работа с рутинными задачами
Как стать синьором
Open your mind for OpenSource
JDI 2.0. Not only UI testing
Out of box page object design pattern, java

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx

А давайте будем многопоточить и масштабировить! - записки сумасшедшего №0

  • 1. MULTITHREADING AND SCALING: Diary of a Madman #0000 TSIMAFEI AVILIN FEBRUARY 26, 2017 Maslenitsa Co.
  • 2. FEBRUARY 26, 2017 API TESTING+ PRE-LOAD TESTING + AZURE MULTITHREADING AND SCALING: Diary of a Madman #0000
  • 3. 3CONFIDENTIAL AGENDA What we want to share: • PROBLEM STATEMENT • MULTI THREADING AS A PRE-LOAD TESTING • SCALING IN AZURE
  • 4. 4CONFIDENTIAL PROBLEM STATEMENT Maslenitsa is being celebrated today and you have to bake 1000 pancakes in a short time, how you gonna do that?
  • 5. 5CONFIDENTIAL STEP BY STEP SOLUTIONS bake 1000 pancakes for one cook – tooooo long! bake 1000 pancakes for a group of cooks – much better! + Good approach!
  • 6. 6CONFIDENTIAL PROBLEM STATEMENT Imagine that you need to perform comparison of many thousands of items in most cases of the same type (files, DB data, strings, etc. )
  • 7. 7CONFIDENTIAL OUR ARCHITECTURE TASK Need to compare thousands of .xml files in a short time… Responses are coming from REST and SOAP services FilestobecomparedinSOAPandRESTservices
  • 8. 8CONFIDENTIAL ONE THREAD, LAPTOP, 1000 files Example of a simple method to compare API responses from REST and SOAP services var comparisionResult = Comparison.Run(validatedUBFContext.FromSOAP, validatedUBFContext.FromREST); Laptop processor: • Processor: Intel® Core™ i5-6300U • # Cores: 2 • # Threads : 4 Time to process 1000 files (each file is about 50-100Kb size of): • 31.30min
  • 9. 9CONFIDENTIAL MUTLITHREADING, SAME LAPTOP, 1000 files MaxDegreeOfParallelism – number of threads var opt = new ParallelOptions { MaxDegreeOfParallelism = int.Parse(ConfigurationManager.AppSettings["DegreeOfParallelization"]) }; Parallel.ForEach(validatedUBFProvider.GetUBFs(ubfStoragePath, opt, validatedUBFContext => {try {var comparisionResult = Comparison.Run(validatedUBFContext.SOAP, validatedUBFContext.REST); } } Degree Time, min 1 31.34 4 10.05 5 8.49 7 8.19 8 7.24 9 6.53 10 6.44 30 6 50 6.22 70 6.56 100 6.35 150 6.14 200 7 0 5 10 15 20 25 30 35 0 20 40 60 80 100 120 Time/Degree Time to process 1000 files is about 6.30 min instead of 31.30min
  • 10. 10CONFIDENTIAL MULTITHREADING AS PRE-LOAD TESTING Even performing this simple testing based on multithreading and sending API requests (.xml files ~ 60.000 files per day ) to both REST and SOAP services, brought out some issues: • DB issues (DB architecture, indexing, procedures, etc.) • API issues (500 internal server error as internal api issues, scaling, etc.) • APP CONFIGURATION issues (no specific configuration file, code regression issues, needs of additional system specific activities like restart IIS which is an issue, etc.) • Indicating of a maximum request size as a system confines • Caching issues • etc.
  • 11. 11CONFIDENTIAL FEBRUARY 26, 2017 GO FORWARD AND USE AZURE PRICES PLANS
  • 12. 12CONFIDENTIAL SCALING IN AZURE : DB (DTU) Database Throughput Unit (DTU): DTUs provide a way to describe the relative capacity of a performance level. DTUs are based on a blended measure of CPU, memory, reads, and writes. As DTUs increase, the power offered by the performance level increases.
  • 14. 14CONFIDENTIAL MUTLITHREADING, SAME LAPTOP, 1000 files, scaling in Azure Because of files to be validatedverifying are processed on VM in Azure (DB + SOAP) on the one hand and REST service on another one, we can try to play with pricing plans to make better performance of DB and a instance where service is running. DTU S2 S0 S0 S0 S1 S3 P1 P2 P2 APP SERVICE S2 S2 S1 S3 S2 S2 S2 S2 P3 Number of threads:10/ min 6.14 6.59 6.49 7.08 6.56 7.01 7.06 6.5 6.57 As it can be seen from the table above, it does not make sense to pay much money for the more expensive prices plans. It’s obvious, because laptop cannot send more requests then the processor allows based on proposed architecture and ‘infrastructure’.
  • 15. 15CONFIDENTIAL MUTLITHREADING, SERVER, 1000 files, scaling in Azure Server processor: • Processor: Intel(R) Xeon(R) CPU E5-2670 0 2.60GHz • # Cores: 8 • # Threads : 16 Time to process 1000 files (each file is about 50-100Kb size of) with 100 threads: • 4.30min Threads DTU APP SERVICE start end dif 100P2 S3 2:49:54 2:54:36 0:04:42 100P1 S3 3:06:25 3:10:49 0:04:24 100S3 S3 3:24:00 3:28:37 0:04:37 100S0 S3 3:58:50 4:04:34 0:05:44 100P2 S1 5:07:30 5:12:27 0:04:57 Scaling in Azure: S0S3 vs S3S3- the difference is only ~1 min, but in case of 20K files it would be about 20min
  • 16. 16CONFIDENTIAL FEBRUARY 26, 2017 THANKS! ДЗЯКУЮ! СПАСИБО!