SlideShare a Scribd company logo
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Hello!
I AM FABIO CICERCHIA
SW & Cloud Engineer @
You can find me at: @fabiocicerchia
Disclaimer
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Let’s Start
Badge Poser v3.0 - A DevOps Journey
https://en.wikipedia.org/wiki/Bianco,_rosso_e_Verdone
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Step #1
What I got myself into?!
Information Gathering
Describe VM Config
RAM: 2GB
CPU: 2
HDD: 50GB
Software: Apache 2.4.10, PHP 5.6.19, Redis 2.8.17, MySQL 5.5.47
● Apache v2.4.10
○ Released on 2014-07-19: Age 6 years
○ Available v2.4.43
● PHP v5.6.19
○ Released on 2016-03-03: Age 4 years
○ Available v7.4.5
○ EOL: 2018-12-31
http://archive.apache.org/dist/httpd/
https://www.php.net/releases/index.php
https://www.php.net/supported-versions.php
https://github.com/redis/redis
https://docs.redislabs.com/latest/rs/administering/product-lifecycle/
Describe VM Config - Notes
● Redis v2.8.17
○ Released on 2014-09-19: Age 6 years
○ Available v6.0.1
● MySQL v5.5.47
○ Released on 2015-12-07: Age 5 years
○ Available v8.0.20
Step #2
What do I need to do?!
Define a “plan”
Step #3
Find time to do it
Badge Poser v3.0 - A DevOps Journey
● Nginx v1.18.0
● PHP v7.4.7
● Redis v4.0.10
Just Start!
https://www.nginx.com/
https://www.php.net/
https://redis.io/
Badge Poser v3.0 - A DevOps Journey
● Ansible → Provisioning
● Ansible Galaxy → Ansible’s Recipes Repo
● AWS CloudFormation → Infrastructure as Code*
● Let’s Encrypt → SSLTLS Certificate**
* Terraform is way cooler
**Yes, SSL is deprecated
...Then Refine
https://www.ansible.com/
https://galaxy.ansible.com/
https://aws.amazon.com/cloudformation/
https://letsencrypt.org/
Badge Poser v3.0 - A DevOps Journey
https://github.com/PUGX/badge-poser/blob/master/sys/cloudformation/alpine-stack.yaml
https://medium.com/@wintonjkt/ansible-101-getting-started-1daaff872b64
Ansible: What’s for?
- Ansible is perfect for VMs (for example EC2 in our scenario).
- It is redundant for ECS with Fargate, since the underlying layer is fully
managed by AWS.
- It could be useful for ECS without Fargate, so it’ll provision the EC2 where
the containers will run.
- Useful for deploy and rollback.
https://github.com/PUGX/badge-poser/blob/54cd440ebc91245cda4735db86dca897d024a838/sys/ansible/playbooks/setup.yml
Wait for it...
Badge Poser v3.0 - A DevOps Journey
Step #4
Start Fixing
Badge Poser v3.0 - A DevOps Journey
Start Throwing a Bunch of Things At It
● pm.max_children = 150
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
● emergency_restart_threshold 10
emergency_restart_interval 1m
process_control_timeout 10s
● memory_limit = 192M
Workaround #1: Not Quite There Yet
Badge Poser v3.0 - A DevOps Journey
Added Logz.io & Filebeat
Added UptimeRobot
It Keeps Crashing: Need Visibility
https://logz.io/
https://www.elastic.co/beats/filebeat
https://uptimerobot.com/
https://medium.com/@mirzapour/centralized-logging-with-elasticsearch-kibana-logstash-and-filebeat-57fea01be5e7
https://github.com/PUGX/badge-poser/blob/54cd440ebc91245cda4735db86dca897d024a838/sys/filebeat/filebeat.yml
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Step #5
Shit Happens
https://en.wikipedia.org/wiki/The_IT_Crowd
FIRE!
FIRE!
FIRE!
Moved to StatusCake
Redis Down: OOM Killer
http://turnoff.us/geek/oom-killer/
https://en.wikipedia.org/wiki/Boris_(TV_series)
Badge Poser v3.0 - A DevOps Journey
Handle Redis Daemon via Supervisor
Redis Down: OOM Killer: Workaround #2
Zero CPU Credits
Zero CPU Credits
CPU capped at 20%
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
CPU capped at 20%
http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
Zero CPU Credits
Badge Poser v3.0 - A DevOps Journey
Step #6
Where Are We At Now?
Badge Poser v3.0 - A DevOps Journey
Step #8
Ditch Everything
Badge Poser v3.0 - A DevOps Journey
Step #9
Start Over
● AWS ECS
● AWS ECR
Container - Part 1
https://aws.amazon.com/ecs/
https://aws.amazon.com/ecr/
Shit Happens (Again)
OOM Killer - The Revenge
http://turnoff.us/geek/oom-killer/
Badge Poser v3.0 - A DevOps Journey
OOM Killer - The Revenge: Workaround #3
● Set Autoscaling fixed to min 1 running container
● Split All-In-One Container in Multi Container
● Use Alpine
Container - Part 2
OOM Killer - Highlander
Badge Poser v3.0 - A DevOps Journey
One Step Back
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
https://github.com/aws/amazon-ecs-agent/issues/1187
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Despite the Working Fix...
...Alpine Wasn’t Quite Stable
Badge Poser v3.0 - A DevOps Journey
Since the multi-container on Alpine was unstable just switched back to the good
ol’ working one-container-has-all on Debian.
Switch Back to All-in-One Debian
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Alpine: Trial & Errors
Badge Poser v3.0 - A DevOps Journey
MADNESS
ALPINE
NGINX+LUA
https://github.com/fabiocicerchia/nginx-lua
Caching to the rescue
NO STALE!
MISS – The response was not found in the cache and so was fetched from an origin server.
The response might then have been cached.
BYPASS – The response was fetched from the origin server instead of served from the
cache because the request matched a proxy_cache_bypass directive (see Can I Punch a Hole
Through My Cache? below.) The response might then have been cached.
EXPIRED – The entry in the cache has expired. The response contains fresh content from
the origin server.
Cache Statuses
https://www.nginx.com/blog/nginx-caching-guide/
Cache Statuses
STALE – The content is stale because the origin server is not responding correctly, and
proxy_cache_use_stale was configured.
UPDATING – The content is stale because the entry is currently being updated in response
to a previous request, and proxy_cache_use_stale updating is configured.
REVALIDATED – The proxy_cache_revalidate directive was enabled and NGINX verified
that the current cached content was still valid (If-Modified-Since or If-None-Match).
HIT – The response contains valid, fresh content direct from the cache.
https://www.nginx.com/blog/nginx-caching-guide/
Step #10
Observability
Moving away from EC2 and from Logz.io.
Again?
Need to know the traffic trend
CloudWatch
Get More Metrics & Desiderata
0
0
Interlude #1
Serverless
https://bref.sh/
Badge Poser v3.0 - A DevOps Journey
https://github.com/brefphp/bref/issues/497
Badge Poser v3.0 - A DevOps Journey
https://aws.amazon.com/blogs/compute/introducing-the-new-serverless-lamp-stack/
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Interlude #2
PHP8.0.0RC*
https://wiki.php.net/todo/php80
Rolling Updates
https://dzone.com/articles/take-release-automation-to-the-next-level-episode-2
Dark Canary
10% / 25%
100%
https://landing.google.com/sre/workbook/chapters/canarying-releases/
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
FORKED TRAFFIC
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
https://github.com/PUGX/badge-poser/pull/431
Interlude #3
Full Page Caching w/ Redis
https://github.com/fabiocicerchia/go-proxy-cache
Step #11
Uptime
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
...but at the end....
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
https://uptime.is/99.97
Deploying during breakfast
Confidence Level
Step #12
Billing
Badge Poser v3.0 - A DevOps Journey
Badge Poser v3.0 - A DevOps Journey
Elastic Static IP with Global Accelerator
https://www.vice.com/it/article/evdyj4/hackerino-computer-militare-video
Auto Refreshing Dashboard
Badge Poser v3.0 - A DevOps Journey
https://www.vice.com/it/article/evdyj4/hackerino-computer-militare-video
Reduce Costs!
So what did I learn?!
Key Takeaways
- Never trust code
- Never trust yourself
- Do small steps
- It’ll help you figuring out what went wrong
- Version everything
- Commit as often as possible
- Never use latest tag
- Use specific versions
- Think outside the box
- Don’t stick to playing by the manual
- Prefer quick and easy fixes
- Reduce the odds of breaking things
- Use the tools to make your life easier
- So choose them carefully
- Monitor & Benchmark!
- Your best friends for troubleshooting
* random order
Questions?
Thank You!

More Related Content

PDF
Converting Your Dev Environment to a Docker Stack - php[world]
PDF
Converting Your Dev Environment to a Docker Stack - Cascadia
PDF
Developing and Deploying PHP with Docker
PDF
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
ODP
Scaling your jenkins master with docker
PPTX
Gorush: A push notification server written in Go
PDF
Desarrollo web backend: Spring Boot, MongoDB y Azure
PDF
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - Cascadia
Developing and Deploying PHP with Docker
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Scaling your jenkins master with docker
Gorush: A push notification server written in Go
Desarrollo web backend: Spring Boot, MongoDB y Azure
PHP Conference Argentina 2013 - Independizate de tu departamento IT - Habilid...

What's hot (20)

PDF
Использование Docker в CI / Александр Акбашев (HERE Technologies)
PPTX
JUC 2015 Pipeline Scaling
PDF
Deep dark-side of git: How git works internally
PDF
Git internals
PDF
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
PDF
Windows attacks - AT is the new black
PDF
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
PDF
Jump into Squeak - Integrate Squeak projects with Docker & Github
PDF
OpenRestyを用いてイケイケなサービスを作る方法
PDF
Docker 導入:障礙與對策
PDF
DevOops & How I hacked you DevopsDays DC June 2015
PDF
Open Canary - novahackers
PPTX
drone continuous Integration
PPTX
An introduction to php shells
PDF
PDF
Docker + Microservices in Production
PDF
CentOS Stream at Facebook
PDF
The KNOT DNS Server
PPTX
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
PDF
How to successfully migrate to bazel from maven or gradle
Использование Docker в CI / Александр Акбашев (HERE Technologies)
JUC 2015 Pipeline Scaling
Deep dark-side of git: How git works internally
Git internals
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Windows attacks - AT is the new black
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Jump into Squeak - Integrate Squeak projects with Docker & Github
OpenRestyを用いてイケイケなサービスを作る方法
Docker 導入:障礙與對策
DevOops & How I hacked you DevopsDays DC June 2015
Open Canary - novahackers
drone continuous Integration
An introduction to php shells
Docker + Microservices in Production
CentOS Stream at Facebook
The KNOT DNS Server
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
How to successfully migrate to bazel from maven or gradle
Ad

Similar to Badge Poser v3.0 - A DevOps Journey (20)

PPTX
PHP and FastCGI Performance Optimizations
PDF
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
PDF
DevOps Bootcamp course resource (1)-1-99.pdf
PPTX
Pipe your script to slack
KEY
Ruby and Rails Packaging to Production
PDF
Docker Advanced registry usage
KEY
Joomla! Day Poland 2012 - Active Security for Joomla! sites
PDF
Manual 5
PDF
Art of Web Backdoor - Pichaya Morimoto
PDF
Php through the eyes of a hoster phpbnl11
PPTX
Lessons Learned in Automating Compliance for Containers
PPTX
2012 coscup - Build your PHP application on Heroku
PDF
Learning Docker with Thomas
PDF
Comment améliorer le quotidien des Développeurs PHP ?
PPTX
Advancing Bitcoin 2019 - BTCPayServer Architecture
PDF
Php through the eyes of a hoster
PPTX
Introduction to Docker
PDF
What's New and Newer in Apache httpd-24
PPTX
Scaling Development Environments with Docker
KEY
Php through the eyes of a hoster: PHPNW10
PHP and FastCGI Performance Optimizations
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
DevOps Bootcamp course resource (1)-1-99.pdf
Pipe your script to slack
Ruby and Rails Packaging to Production
Docker Advanced registry usage
Joomla! Day Poland 2012 - Active Security for Joomla! sites
Manual 5
Art of Web Backdoor - Pichaya Morimoto
Php through the eyes of a hoster phpbnl11
Lessons Learned in Automating Compliance for Containers
2012 coscup - Build your PHP application on Heroku
Learning Docker with Thomas
Comment améliorer le quotidien des Développeurs PHP ?
Advancing Bitcoin 2019 - BTCPayServer Architecture
Php through the eyes of a hoster
Introduction to Docker
What's New and Newer in Apache httpd-24
Scaling Development Environments with Docker
Php through the eyes of a hoster: PHPNW10
Ad

Recently uploaded (20)

PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administration Chapter 2
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
AI in Product Development-omnex systems
PPTX
Introduction to Artificial Intelligence
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Operating system designcfffgfgggggggvggggggggg
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Migrate SBCGlobal Email to Yahoo Easily
Digital Strategies for Manufacturing Companies
System and Network Administration Chapter 2
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo POS Development Services by CandidRoot Solutions
AI in Product Development-omnex systems
Introduction to Artificial Intelligence
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
Navsoft: AI-Powered Business Solutions & Custom Software Development
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Badge Poser v3.0 - A DevOps Journey