SlideShare a Scribd company logo
Radek Baczyński, Warszawa - 22.11.2018
Docker for Mac & local dev
environment optimization
Presentation title · Title of the chapter - 00/2018 2
● Same environment as production server
● Same environment on each dev machine
● Immutable infrastructure
● Easy setup & configuration
● Easy upgrades of services
Why docker on dev machine?
Docker for Mac i optymalizacja środowiska developerskiego
● Opcache settings
○ memory_consumption
○ max_accelerated_files
● PHP settings:
○ realpath_cache_size
○ Realpath_cache_ttl
● Doctrine
○ metadata_cache_driver
○ query_cache_driver
○ result_cache_driver
Basic performance optimization
3
● Docker for Mac
○ edge version
○ .raw disk
○ APFS mac file system
○ Preferences → File sharing
■ Limit to your “project”
dir
● Symfony
○ Log to /dev/stdout
○ Disable profiler?
Docker for Mac i optymalizacja środowiska developerskiego
Mac
Linux VM
Docker
4
osxfs
mounted
volume
📄
index.php
📄
index.php
Docker for Mac i optymalizacja środowiska developerskiego
👍 Same user experience
5
👎 Poor performance
Docker for Mac
Docker for Mac i optymalizacja środowiska developerskiego
● Aggressive opcache
○ opcache.validate_timestamps=0
● RAM disk
● NFS
● PHP 7.4
○ https://wiki.php.net/rfc/preload
Alternative ideas
6
Presentation title · Title of the chapter - 00/2018
Benchmark 1
Default setup
7Presentation title · Title of the chapter - 00/2018
services:
backend:
image: php-7.2
volumes:
- ./:/app
ports:
- 8080:8080
2578ms
Presentation title · Title of the chapter - 00/2018
Benchmark 2
Removed xdebug extension
8Presentation title · Title of the chapter - 00/2018
services:
backend:
image: php-7.2
volumes:
- ./:/app
ports:
- 8080:8080
1058ms
Docker for Mac i optymalizacja środowiska developerskiego
:delegated
:cached
9
Docker for mac half-solution for
performance issue
Presentation title · Title of the chapter - 00/2018
Benchmark 3 Xdebug enabled & Delegated
volume mount
10Presentation title · Title of the chapter - 00/2018
services:
backend:
image: php-7.2
volumes:
- ./:/app:delegated
ports:
- 8080:8080
358ms
Docker for Mac i optymalizacja środowiska developerskiego
● In docker container
run 2 php-fpm processes
○ Port 9000 without xdebug.so
○ Port 9001 with xdebug.so
Xdebug trick
11
Docker for Mac i optymalizacja środowiska developerskiego
2 fpm processes
12
Port:9000, with xdebug.so
Port:9001, without xdebug.so
Docker for Mac i optymalizacja środowiska developerskiego
Nginx config
13
map $cookie_XDEBUG_SESSION $fpm_port {
default 9000;
PHPSTORM 9001;
}
server {
listen 80;
location = / {
rewrite ^/(.*)$ /app_dev.php/$1;
}
location @rewrite {
rewrite ^/(.*)$ /app_dev.php/$1;
autoindex on;
}
location ~ .php {
fastcgi_index app_dev.php;
fastcgi_pass 127.0.0.1:$fpm_port;
#...
}
}
● Map fastcgi port
Presentation title · Title of the chapter - 00/2018
Benchmark 4 Delegated & Removed
xdebug extension
14Presentation title · Title of the chapter - 00/2018
services:
backend:
image: php-7.2
volumes:
- ./:/app:delegated
ports:
- 8080:8080
262ms
Docker for Mac i optymalizacja środowiska developerskiego
Not enough for big
Symfony apps
Real case
15
Presentation title · Title of the chapter - 00/2018
Docplanner Docplanner monolith
● Delegated
● Xdebug trick
● Minor optimizations
16Presentation title · Title of the chapter - 00/2018
2432ms
Docker for Mac i optymalizacja środowiska developerskiego
● Don’t use problematic mounted
volumes
Solution
17
version: '3'
services:
backend:
container_name: symfony_demo
image: php-fpm7.2
volumes:
- ./:/app:delegated
ports:
- 8080:8080
Docker for Mac i optymalizacja środowiska developerskiego
docker-sync
💪 mutagen.io 🔥
Solution
18
Docker for Mac i optymalizacja środowiska developerskiego
● Same idea as docker-sync
● Less problems
● Better performance
● Tight docker integration
● Works with any dockerized app
● Easy to monitor
● Easy to manage
mutagen.io
19
Docker for Mac i optymalizacja środowiska developerskiego
https://asciinema.org/a/KN0Opv0VxsCBNxbGo9ohkb3oX
1. brew install mutagen
2. mutagen daemon start
3. mutagen create PATH_ON_HOST
docker://USER@CONTAINER_NAME/PATH_IN_CONTAINER
4. mutagen monitor
Wait few seconds/minutes for first sync
5. It’s done
mutagen.io
20
Presentation title · Title of the chapter - 00/2018
Benchmark 5
No mounted volumes &
xdebug enabled & mutagen
21Presentation title · Title of the chapter - 00/2018
47ms
Presentation title · Title of the chapter - 00/2018
Benchmark 6
No mounted volumes &
xdebug enabled & mutagen
22Presentation title · Title of the chapter - 00/2018
349ms
Docker for Mac i optymalizacja środowiska developerskiego
● basic php optimizations
● optional xdebug
● mutagen.io
Summary
23
Follow us!
Questions?
Follow us!
Thank you!

More Related Content

What's hot

Introduction to Data Engineer and Data Pipeline at Credit OK
Introduction to Data Engineer and Data Pipeline at Credit OKIntroduction to Data Engineer and Data Pipeline at Credit OK
Introduction to Data Engineer and Data Pipeline at Credit OKKriangkrai Chaonithi
 
InfluxDB 2.0 Client Libraries by Noah Crowley
InfluxDB 2.0 Client Libraries by Noah CrowleyInfluxDB 2.0 Client Libraries by Noah Crowley
InfluxDB 2.0 Client Libraries by Noah CrowleyInfluxData
 
Challenges in Building a Data Pipeline
Challenges in Building a Data PipelineChallenges in Building a Data Pipeline
Challenges in Building a Data PipelineManish Kumar
 
KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)Martin Toshev
 
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
Key Challenges in Cloud Computing and How Yahoo! is Approaching ThemKey Challenges in Cloud Computing and How Yahoo! is Approaching Them
Key Challenges in Cloud Computing and How Yahoo! is Approaching ThemYahoo Developer Network
 
A Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallA Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallInfluxData
 
Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Ryan Blue
 
Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...HostedbyConfluent
 
RESTful with Drupal - in-s and out-s
RESTful with Drupal - in-s and out-sRESTful with Drupal - in-s and out-s
RESTful with Drupal - in-s and out-sKalin Chernev
 
hbaseconasia2017: HBase on Beam
hbaseconasia2017: HBase on Beamhbaseconasia2017: HBase on Beam
hbaseconasia2017: HBase on BeamHBaseCon
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually restJakub Riedl
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Ari Jolma
 
The Data Lake Engine Data Microservices in Spark using Apache Arrow Flight
The Data Lake Engine Data Microservices in Spark using Apache Arrow FlightThe Data Lake Engine Data Microservices in Spark using Apache Arrow Flight
The Data Lake Engine Data Microservices in Spark using Apache Arrow FlightDatabricks
 
Data- How Does It Work-
Data- How Does It Work-Data- How Does It Work-
Data- How Does It Work-Boyang Niu
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in productionPingCAP
 
InfluxDB Internals
InfluxDB InternalsInfluxDB Internals
InfluxDB InternalsInfluxData
 
CEPH DAY BERLIN - WHAT'S NEW IN CEPH
CEPH DAY BERLIN - WHAT'S NEW IN CEPH CEPH DAY BERLIN - WHAT'S NEW IN CEPH
CEPH DAY BERLIN - WHAT'S NEW IN CEPH Ceph Community
 
Scaling Redis: Dmitry Polyakovsky
Scaling Redis: Dmitry PolyakovskyScaling Redis: Dmitry Polyakovsky
Scaling Redis: Dmitry PolyakovskyRedis Labs
 

What's hot (20)

Introduction to Data Engineer and Data Pipeline at Credit OK
Introduction to Data Engineer and Data Pipeline at Credit OKIntroduction to Data Engineer and Data Pipeline at Credit OK
Introduction to Data Engineer and Data Pipeline at Credit OK
 
InfluxDB 2.0 Client Libraries by Noah Crowley
InfluxDB 2.0 Client Libraries by Noah CrowleyInfluxDB 2.0 Client Libraries by Noah Crowley
InfluxDB 2.0 Client Libraries by Noah Crowley
 
Challenges in Building a Data Pipeline
Challenges in Building a Data PipelineChallenges in Building a Data Pipeline
Challenges in Building a Data Pipeline
 
KDB+ Lite
KDB+ LiteKDB+ Lite
KDB+ Lite
 
KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)KDB database (EPAM tech talks, Sofia, April, 2015)
KDB database (EPAM tech talks, Sofia, April, 2015)
 
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
Key Challenges in Cloud Computing and How Yahoo! is Approaching ThemKey Challenges in Cloud Computing and How Yahoo! is Approaching Them
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
 
A Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallA Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim Hall
 
Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)
 
Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...
 
RESTful with Drupal - in-s and out-s
RESTful with Drupal - in-s and out-sRESTful with Drupal - in-s and out-s
RESTful with Drupal - in-s and out-s
 
hbaseconasia2017: HBase on Beam
hbaseconasia2017: HBase on Beamhbaseconasia2017: HBase on Beam
hbaseconasia2017: HBase on Beam
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually rest
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
The Data Lake Engine Data Microservices in Spark using Apache Arrow Flight
The Data Lake Engine Data Microservices in Spark using Apache Arrow FlightThe Data Lake Engine Data Microservices in Spark using Apache Arrow Flight
The Data Lake Engine Data Microservices in Spark using Apache Arrow Flight
 
Data- How Does It Work-
Data- How Does It Work-Data- How Does It Work-
Data- How Does It Work-
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in production
 
InfluxDB Internals
InfluxDB InternalsInfluxDB Internals
InfluxDB Internals
 
TiDB Introduction
TiDB IntroductionTiDB Introduction
TiDB Introduction
 
CEPH DAY BERLIN - WHAT'S NEW IN CEPH
CEPH DAY BERLIN - WHAT'S NEW IN CEPH CEPH DAY BERLIN - WHAT'S NEW IN CEPH
CEPH DAY BERLIN - WHAT'S NEW IN CEPH
 
Scaling Redis: Dmitry Polyakovsky
Scaling Redis: Dmitry PolyakovskyScaling Redis: Dmitry Polyakovsky
Scaling Redis: Dmitry Polyakovsky
 

Similar to Docker for mac & local developer environment optimization

Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsBruno Padilha
 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDocker, Inc.
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivAleksey Asiutin
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For DevelopmentLaura Frank Tacho
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaŁukasz Piątkowski
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with dockerMaciej Lukianski
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosjasonholtzapple
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With ContainersHanoi MagentoMeetup
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotClouddaoswald
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsMarcelo Pinheiro
 

Similar to Docker for mac & local developer environment optimization (20)

Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker Containers
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For Development
 
Nginx pres
Nginx presNginx pres
Nginx pres
 
DockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing AureaDockerCon EU '17 - Dockerizing Aurea
DockerCon EU '17 - Dockerizing Aurea
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagios
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 

Docker for mac & local developer environment optimization

  • 1. Radek Baczyński, Warszawa - 22.11.2018 Docker for Mac & local dev environment optimization
  • 2. Presentation title · Title of the chapter - 00/2018 2 ● Same environment as production server ● Same environment on each dev machine ● Immutable infrastructure ● Easy setup & configuration ● Easy upgrades of services Why docker on dev machine?
  • 3. Docker for Mac i optymalizacja środowiska developerskiego ● Opcache settings ○ memory_consumption ○ max_accelerated_files ● PHP settings: ○ realpath_cache_size ○ Realpath_cache_ttl ● Doctrine ○ metadata_cache_driver ○ query_cache_driver ○ result_cache_driver Basic performance optimization 3 ● Docker for Mac ○ edge version ○ .raw disk ○ APFS mac file system ○ Preferences → File sharing ■ Limit to your “project” dir ● Symfony ○ Log to /dev/stdout ○ Disable profiler?
  • 4. Docker for Mac i optymalizacja środowiska developerskiego Mac Linux VM Docker 4 osxfs mounted volume 📄 index.php 📄 index.php
  • 5. Docker for Mac i optymalizacja środowiska developerskiego 👍 Same user experience 5 👎 Poor performance Docker for Mac
  • 6. Docker for Mac i optymalizacja środowiska developerskiego ● Aggressive opcache ○ opcache.validate_timestamps=0 ● RAM disk ● NFS ● PHP 7.4 ○ https://wiki.php.net/rfc/preload Alternative ideas 6
  • 7. Presentation title · Title of the chapter - 00/2018 Benchmark 1 Default setup 7Presentation title · Title of the chapter - 00/2018 services: backend: image: php-7.2 volumes: - ./:/app ports: - 8080:8080 2578ms
  • 8. Presentation title · Title of the chapter - 00/2018 Benchmark 2 Removed xdebug extension 8Presentation title · Title of the chapter - 00/2018 services: backend: image: php-7.2 volumes: - ./:/app ports: - 8080:8080 1058ms
  • 9. Docker for Mac i optymalizacja środowiska developerskiego :delegated :cached 9 Docker for mac half-solution for performance issue
  • 10. Presentation title · Title of the chapter - 00/2018 Benchmark 3 Xdebug enabled & Delegated volume mount 10Presentation title · Title of the chapter - 00/2018 services: backend: image: php-7.2 volumes: - ./:/app:delegated ports: - 8080:8080 358ms
  • 11. Docker for Mac i optymalizacja środowiska developerskiego ● In docker container run 2 php-fpm processes ○ Port 9000 without xdebug.so ○ Port 9001 with xdebug.so Xdebug trick 11
  • 12. Docker for Mac i optymalizacja środowiska developerskiego 2 fpm processes 12 Port:9000, with xdebug.so Port:9001, without xdebug.so
  • 13. Docker for Mac i optymalizacja środowiska developerskiego Nginx config 13 map $cookie_XDEBUG_SESSION $fpm_port { default 9000; PHPSTORM 9001; } server { listen 80; location = / { rewrite ^/(.*)$ /app_dev.php/$1; } location @rewrite { rewrite ^/(.*)$ /app_dev.php/$1; autoindex on; } location ~ .php { fastcgi_index app_dev.php; fastcgi_pass 127.0.0.1:$fpm_port; #... } } ● Map fastcgi port
  • 14. Presentation title · Title of the chapter - 00/2018 Benchmark 4 Delegated & Removed xdebug extension 14Presentation title · Title of the chapter - 00/2018 services: backend: image: php-7.2 volumes: - ./:/app:delegated ports: - 8080:8080 262ms
  • 15. Docker for Mac i optymalizacja środowiska developerskiego Not enough for big Symfony apps Real case 15
  • 16. Presentation title · Title of the chapter - 00/2018 Docplanner Docplanner monolith ● Delegated ● Xdebug trick ● Minor optimizations 16Presentation title · Title of the chapter - 00/2018 2432ms
  • 17. Docker for Mac i optymalizacja środowiska developerskiego ● Don’t use problematic mounted volumes Solution 17 version: '3' services: backend: container_name: symfony_demo image: php-fpm7.2 volumes: - ./:/app:delegated ports: - 8080:8080
  • 18. Docker for Mac i optymalizacja środowiska developerskiego docker-sync 💪 mutagen.io 🔥 Solution 18
  • 19. Docker for Mac i optymalizacja środowiska developerskiego ● Same idea as docker-sync ● Less problems ● Better performance ● Tight docker integration ● Works with any dockerized app ● Easy to monitor ● Easy to manage mutagen.io 19
  • 20. Docker for Mac i optymalizacja środowiska developerskiego https://asciinema.org/a/KN0Opv0VxsCBNxbGo9ohkb3oX 1. brew install mutagen 2. mutagen daemon start 3. mutagen create PATH_ON_HOST docker://USER@CONTAINER_NAME/PATH_IN_CONTAINER 4. mutagen monitor Wait few seconds/minutes for first sync 5. It’s done mutagen.io 20
  • 21. Presentation title · Title of the chapter - 00/2018 Benchmark 5 No mounted volumes & xdebug enabled & mutagen 21Presentation title · Title of the chapter - 00/2018 47ms
  • 22. Presentation title · Title of the chapter - 00/2018 Benchmark 6 No mounted volumes & xdebug enabled & mutagen 22Presentation title · Title of the chapter - 00/2018 349ms
  • 23. Docker for Mac i optymalizacja środowiska developerskiego ● basic php optimizations ● optional xdebug ● mutagen.io Summary 23