Matteo Moretti discusses scaling PHP applications. He covers scaling the web server, sessions, database, filesystem, asynchronous tasks, and logging. The key aspects are decoupling services, using caching, moving to external services like Redis, S3, and RabbitMQ, and allowing those services to scale automatically using techniques like auto-scaling. Sharding the database is difficult to implement and should only be done if really needed.
- The document introduces Docker, explaining that it provides standardized packaging for software and dependencies to isolate applications and share the same operating system kernel.
- Key aspects of Docker are discussed, including images which are layered and can be version controlled, containers which start much faster than virtual machines, and Dockerfiles which provide build instructions for images.
- The document demonstrates Docker's build, ship, and run workflow through examples of building a simple image and running a container, as well as using Docker Compose to run multi-container applications like WordPress. It also introduces Docker Swarm for clustering multiple Docker hosts.
https://youtu.be/K1V_xtcGCl4
Git Workshop
Manjoy Malhotra on November 5, 2022
Have you been struggling to start contributing to our Open Source Initiative projects? Do you just need a refresher for CSC207?
No matter if you're from UTM, UTSG, or even high school, git a head start by attending our workshop, entirely online! 🐙
You'll be even more ready to win prizes (maybe from even GitHub 👀) by contributing to our open source projects 👀👀👀👀
We've be covering the basics of how git works, so that you'll be set up for contribution in no time.
A introduction to Microservices Architecture: definition, characterstics, framworks, success stories. It contains a demo about implementation of microservices with Spring Boot, Spring cloud an Eureka.
An edge gateway is an essential piece of infrastructure for large scale cloud based services. This presentation details the purpose, benefits and use cases for an edge gateway to provide security, traffic management and cloud cross region resiliency. How a gateway can be used to enhance continuous deployment, and help testing of new service versions and get service insights and more are discussed. Philosophical and architectural approaches to what belongs in a gateway vs what should be in services will be discussed. Real examples of how gateway services are used in front of nearly all of Netflix's consumer facing traffic will show how gateway infrastructure is used in real highly available, massive scale services.
The document discusses various Git branching strategies, including:
- Common concepts like branches, merges, and pull requests
- Popular workflows like GitHub Flow and branching per platform/release
- A case study of Telenet's workflow of using long-running release branches merged from master for testing before production deployment
- Best practices like using pull requests for code reviews, keeping long-running branches stable, and ensuring features are fully tested before being merged.
Application Architecture: The Next Wave | MuleSoftMuleSoft
The way we build applications is changing. By analyzing architecture trends of the past and studying forward thinking infrastructures at Apple and Netflix we present a compelling framework for how to think about the future as the traditional application stack is redefined.
The purpose of this solution is to go over the Docker basics which explain containers, images, how they work, where to find them, the architecture (client, daemon), the difference between Docker and VMs, and we will see Docker and an image and see some commands.
This document provides an agenda and notes for a 3-day AWS, Terraform, and advanced techniques training. Day 1 covers AWS networking, scaling techniques, automation with Terraform and covers setting up EC2 instances, autoscaling groups, and load balancers. Day 2 continues EC2 autoscaling, introduces Docker, ECS, monitoring, and continuous integration/delivery. Topics include IAM, VPC networking, NAT gateways, EC2, autoscaling policies, ECS clusters, Docker antipatterns, monitoring servers/applications/logs, and Terraform code structure. Day 3 will cover Docker, ECS, configuration management, Vault, databases, Lambda, and other advanced AWS and DevOps topics.
Introduction to Team Foundation Server (TFS) OnlineDenis Voituron
TFS est la plateforme de collaboration qui se trouve au coeur de la solution de gestion du cycle de vie des applications (ALM) de Microsoft. Pour de petites équipes de développement (5 users), TFS est disponible online et gratuitement.
Lors de cette session, principalement à base d'exemples pratiques, nous aborderons les modules Source Controle, Collaborate (gestion des tâches et des bugs) et Automatic Builds (compilations et déploiements automatisés).
Logging best practice in mule using logger componentGovind Mulinti
Logging is a key part of application debugging and analysis. This document discusses best practices for logging in Mule applications using the logger component. It recommends configuring log4j to use RollingFileAppender to control log file sizes. The logger component should be used to log messages with the log level and category string providing meaning. The category string should indicate the project, functionality, and flow being logged to help decode where log messages originate. Log4j properties can enable logging at granular levels like specific flows by configuring logger categories. Following these practices helps support teams debug issues faster through meaningful logs.
I was inspired to use GIT much more reliably after reading about Git Flow. I got a little lost until I read "Why Aren't You Using Git Flow?". I decided to do a presentation for OrlandoPHP to try and share my enthusiasm with them.
Thank you to Vincent Driessen and Jeff Kreeftmeijer for being my inspiration.
HCL Nomad Web 101: Skip the Mistakes and Get on the Fast Trackpanagenda
Recording: https://www.panagenda.com/webinars/hcl-nomad-web-101-skip-the-mistakes-and-get-on-the-fast-track/
Nomad Web is HCL’s answer for the future of Notes/Domino. It is a (mostly) new client, built on a new and promising technology stack (WebAssembly). But: New tech brings new challenges. Many of the ways you used to solve common operational challenges for Notes no longer apply or need to be rethought.
Your priority is to find ways to minimize productivity loss and support tickets such a big change will undoubtedly bring. You need to train users, optimize the client and user experience, and deal with new technical challenges you face by living inside a browser. This means you need in-depth knowledge of this new client and the platform it runs on – all of which is new, in constant flux, and there’s not too many online resources to be found and learned from. Altogether an enormous task. To top it off, there’s some fundamental challenges such as running Nomad on Citrix (without reinstalling and wiping their settings every time a user logs in). But don’t despair: We can help!
In this webinar, HCL Ambassador and rock star Christoph Adler will provide you leading edge insights and lessons learned from working with Nomad Web from before the first public beta.
Learn how Nomad works, how users experience it in their daily work, what to be careful about, what to look for when problems occur, and how to handle common operational scenarios. Skip a few months of struggling by yourself and instead start into the new world with a solid foundation.
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Simplilearn
This presentation on "Introduction to DevOps" will help you understand what is waterfall model, what is an agile model, what is DevOps, DevOps phases, DevOps tools and DevOps advantages. In traditional software development lifecycle, there is a lot of gap between development and operations team. DevOps addresses the gap between developers and operations. The development team will submit the application to the operations team for implementation. Operations team will monitor the application and provide relevant feedback to developers. According to DevOps practices, the workflow in software development and delivery is divided into 8 phases, Now, let us get started and understand these 8 phases in DevOps.
Below topics are explained in this "Introduction to DevOps" presentation:
1. Waterfall model
2. Agile model
3. What is DevOps?
4. DevOps phases
5. DevOps tools
6. DevOps advantages
Simplilearn's DevOps Certification Training Course will prepare you for a career in DevOps, the fast-growing field that bridges the gap between software developers and operations. You’ll become an expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
Why learn DevOps?
Simplilearn’s DevOps training course is designed to help you become a DevOps practitioner and apply the latest in DevOps methodology to automate your software development lifecycle right out of the class. You will master configuration management; continuous integration deployment, delivery and monitoring using DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios in a practical, hands-on and interactive approach. The Devops training course focuses heavily on the use of Docker containers, a technology that is revolutionizing the way apps are deployed in the cloud today and is a critical skillset to master in the cloud age.
Who should take this course?
DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit.
1. This DevOps training course will be of benefit the following professional roles:
2. Software Developers
3. Technical Project Managers
4. Architects
5. Operations Support
6. Deployment engineers
7. IT managers
8. Development managers
Learn more at: https://www.simplilearn.com/
Short Introduction to Docker. These slides show the basic idea behind the container technology Docker. The slides present the basic features for the daily use with Docker, Docker Compose, Docker Machine and Docker Swarm.
Docker is specially important for DevOps, because it gives Software Developers more control about their dependencies in different environments.
This document discusses scaling Symfony applications. It begins by introducing the speaker and their experience scaling large applications. It then covers scaling different aspects of an application including the web server, sessions, database, and filesystem. For each area, it provides recommendations such as using PHP opcode caching, storing sessions in Redis or Memcached, considering database sharding for very large databases, and using an abstraction layer like FlysystemBundle to store files in cloud storage like Amazon S3. The overall message is that scaling can be achieved through configuration changes and decoupling services rather than code changes.
This presentation discusses performance and scalability testing and optimization for Drupal websites. It covers capacity planning, tools for testing and analysis, common bottlenecks, caching, database optimization, and Apache configuration tips. Specific technologies and modules mentioned include Varnish, APC, MySQL query cache, and Drupal caching.
In this session we will present an overview from the point of view 'system that implementative on how to get the best performance from your drupal application.
We will also show examples of use cases for drupal scalable infrastructure.
This document summarizes a presentation on optimizing Joomla performance. It describes two parts to the presentation:
Part 1 covers basic application-level optimizations for Joomla like keeping Joomla updated, choosing extensions wisely, simplifying templates, and using plugins and .htaccess rules to enable caching and compression.
Part 2 discusses server-level optimizations like using a CDN, opcode caching with APC and Memcached, and reverse proxy servers like Nginx and Varnish. It provides configuration examples and presents results of benchmark tests showing improvements from optimizations.
Testing Delphix: easy data virtualizationFranck Pachot
The document summarizes the author's testing of the Delphix data virtualization software. Some key points:
- Delphix allows users to easily provision virtual copies of database sources on demand for tasks like testing, development, and disaster recovery.
- It works by maintaining incremental snapshots of source databases and virtualizing the data access. Copies can be provisioned in minutes and rewound to past points in time.
- The author demonstrated provisioning a copy of an Oracle database using Delphix and found the process very simple. Delphix integrates deeply with databases.
- Use cases include giving databases to each tester/developer, enabling continuous integration testing, creating QA environments with real
This document discusses caching strategies for websites built with Drupal. It recommends caching content at multiple levels, including code-level caching within Drupal, resource caching of assets like CSS and JavaScript using tools like Boost and Varnish, database caching with Memcached, and caching of static content on third-party networks like Akamai and Cloudflare. Debugging caching issues requires monitoring each caching layer and analyzing HTTP headers to determine where content is failing to cache properly. Caching is important for performance but must be implemented carefully to avoid breaking site functionality or creating new bugs during debugging.
Rami Jarvinen discusses optimizing performance on Drupal sites. He outlines several caching strategies including PHP opcode caching, Drupal internal caching, page caching, and reverse proxy caching using Boost or Varnish. Memcached can be used as a high-performance replacement for Drupal's database caching. Scaling can involve using a master-slave database setup and serving static files from a separate server. Profiling tools can identify SQL bottlenecks and unnecessary queries for optimization. The optimal solution depends on factors like the number of anonymous vs logged-in users and the capabilities of the hosting environment.
Drupalcamp Estonia - High Performance Sitesdrupalcampest
Rami Jarvinen discusses optimizing performance on Drupal sites. He outlines several caching layers that can be implemented including PHP opcode caching, Drupal internal caching, page caching, and reverse proxy caching using Boost or Varnish. He also discusses scaling Drupal through techniques such as MySQL master-slave configuration, serving static files from Nginx/lighttpd, and adding frontend servers. Profiling with tools like Xdebug can help identify SQL bottlenecks to optimize. The optimal caching and performance strategy depends on each site's specific usage and hosting environment.
Drupal performance optimization best practices include:
- Disabling unused modules and cron on production to reduce overhead
- Configuring caching at the application level with modules like Boost and Memcache
- Optimizing server configuration through APC caching, CDN integration, browser caching, and cron job configuration
- Improving database performance by optimizing InnoDB settings and enabling the query cache
The document provides best practices for optimizing Drupal performance at the application, server, and database levels to reduce bottlenecks and improve load times.
phptek13 - Caching and tuning fun tutorialWim Godden
This document discusses caching and tuning techniques to improve scalability for web applications. It begins with an introduction and background on caching. It then covers different caching techniques including caching entire pages, parts of pages, SQL queries, and complex PHP results. It discusses various caching storage options such as the MySQL query cache, memory tables, opcode caching with APC, disk, memory disk, Memcache, and notes on each. The document provides code examples for using Memcache and discusses caching strategies such as updating cached data, cache stampeding, and cache warming scripts. It also covers performance benchmarks and moving to Nginx with PHP-FPM. The overall goal of the techniques discussed is to increase reliability, performance and scalability of a
This document summarizes different caching techniques that can be used with PHP, including caching content, database caching, and memory caching using APCU, Memcached, and Redis. It provides code examples for storing, getting, and deleting values from the cache with each technique. Specifically, it shows how to cache objects in memory and check the cache before querying a database to improve performance.
The DrupalCampLA 2011 presentation on backend performance. The slides go over optimizations that can be done through the LAMP (or now VAN LAMMP stack for even more performance) to get everything up and running.
This document provides information on improving Drupal performance through various techniques including performance testing, caching, optimizing database and server configurations, using tools like Varnish, load balancers, and CDNs, and addressing inefficient code. It also discusses a case study of using scalable cloud hosting and caching strategies to handle peak traffic for a site during major awards events.
This presentation reviews of the many aspects of PHP performance that can impact day-to-day living. It explores basic concepts for resolution when PHP performance has got you down. The focus is on Zend Server configuration options including, but not limited to: caching, Apache settings, PHP syntax fundamentals, diagnosing bottlenecks, and DB2/SQL optimization.
The document discusses scaling a web application called Wanelo that is built on PostgreSQL. It describes 12 steps for incrementally scaling the application as traffic increases. The first steps involve adding more caching, optimizing SQL queries, and upgrading hardware. Further steps include replicating reads to additional PostgreSQL servers, using alternative data stores like Redis where appropriate, moving write-heavy tables out of PostgreSQL, and tuning PostgreSQL and the underlying filesystem. The goal is to scale the application while maintaining PostgreSQL as the primary database.
This document discusses strategies for making Ruby on Rails applications highly available. It covers common architectures using a single server, and moving to distributed systems. Key topics include application modularity, useful gems for asynchronous processing, database replication, session management, application deployment, configuration management, and load balancing. The conclusion emphasizes that porting Rails apps to a highly available environment requires thinking about architecture and distribution early, but is not prohibitively difficult if approached methodically.
Caching and tuning fun for high scalabilityWim Godden
Caching has been a 'hot' topic for a few years. But caching takes more than merely taking data and putting it in a cache : the right caching techniques can improve performance and reduce load significantly. But we'll also look at some major pitfalls, showing that caching the wrong way can bring down your site. If you're looking for a clear explanation about various caching techniques and tools like Memcached, Nginx and Varnish, as well as ways to deploy them in an efficient way, this talk is for you.
The need to scale is in high demand in an age where everything is moving to the cloud. Though the standard Apache configuration could handle a website with moderate traffic, the minute it gets slash dotted or twitted multiple times could spell an embarrassing crash landing! If you are the administrator of such a website then good luck finding another job! On the other hand you value high availability in the midst of popularity then read on. On this one day workshop, we will show you how to scale your website and webapps to scale to handle thousands of simultaneous sessions the right way. The topics covered will include:
- Setting up Apache and NGiNXM
- Setting up a sample LAMP web app
- Benchmarking Apache performance
- Fine tuning Apache to improve performance
- Fine tuning NGiNX to improve performance
- Discussion about code level improvements when developing custom webapps using PHP
BDRSuite - #1 Cost effective Data Backup and Recovery Solutionpraveene26
BDRSuite and BDRCloud by Vembu are comprehensive and cost-effective backup and disaster recovery solutions designed to meet the diverse data protection requirements of Businesses and Service Providers.
With BDRSuite & BDRCloud, you can backup diverse IT workloads from any location, including VMs (VMware, Hyper-V, KVM, Proxmox VE, oVirt), Servers & Endpoints (Windows, Linux, Mac), SaaS Applications (Microsoft 365, Google Workspace), Cloud VMs (AWS, Azure), NAS/File Shares and Databases & Applications (Microsoft Exchange Server, SQL Server, SharePoint Server, PostgreSQL, MySQL).
You can store backup anywhere like On-Premise/Remote storage, Private/Public Cloud, and BDRCloud.
You can centrally manage the entire backup infrastructure with BDRSuite’s self-hosted centralized management console (or) BDRCloud-hosted centralized management console.
You can quickly recover from data loss or ransomware attacks—all at an affordable price.
To know more visit our website -
https://www.bdrsuite.com/
https://www.bdrcloud.com/
pgroll - Zero-downtime, reversible, schema migrations for PostgresTudor Golubenco
pgroll is an open source command-line tool that offers safe and reversible schema migrations for PostgreSQL by serving multiple schema versions simultaneously. It takes care of the complex migration operations to ensure that client applications continue working while the database schema is being updated. This includes ensuring changes are applied without locking the database, and that both old and new schema versions work simultaneously (even when breaking changes are being made!). This removes risks related to schema migrations, and greatly simplifies client application rollout, also allowing for instant rollbacks.
Empowering Businesses with Intelligent Software Solutions - GrawlixAarisha Shaikh
Explore Grawlix's comprehensive suite of intelligent software solutions designed to drive transformative growth and scalability for businesses. This presentation covers our expertise in bespoke software development, digital marketing, web design, cloud solutions, cybersecurity, AI/ML, and IT consulting. Discover how Grawlix's customized solutions enhance productivity, streamline processes, and enable data-driven decision-making. Learn about our key projects, technologies, and the dedicated team who ensures exceptional client satisfaction through innovation and excellence.
Laravel has quickly become one of the leading PHP frameworks. Its elegant syntax, powerful features, and strong community backing make it a top choice for developers. This article delves into what makes Laravel development stand out and why it is considered the best PHP framework for modern web applications.
Three available editions of Windows Servers crucial to your organization’s op...Q-Advise
Three available editions of Windows Servers crucial to your organization’s operations
Windows Server, Microsoft’s robust operating system, is the cornerstone of enterprise IT infrastructure, tailored for mission-critical operations. It helps in managing enterprise-level tasks, including data storage, applications, and communication.
Proper licensing of Windows Server is essential for both legal compliance and optimal functionality within business environments.
Windows Server comes in various edition and before any edition is used in your organization, it is required you license them appropriately. The licensing can be complex and capital demanding when you don’t know what you want or understand the licensing requirements.
Even if successfully licensed, there are various activities you can practice as an organization to make sure your Server is operating optimally and there is real value for money. This requires a deeper understanding of best practices and our team of cloud and licensing experts can be of support.
Send the team an email, info@q-advise.com let’s have a look at your needs, together with you decide which licensing model will best work in your case, assist you with savings options and share with you how pre-owned licensing can help you get licensed adequately also.
TEQnation 2024: Sustainable Software: May the Green Code Be with Youmarcofolio
In a galaxy not so far away, software development is taking on an eco-friendly twist! Join me for a journey into the world of Green Software Development, where we explore how the Force of sustainability can be harnessed to create a better, greener future for software and the planet.
We'll fly away to various topics, including:
- The Green Side of Code: Discover the fundamental principles of Green Software Development and how they can lead to reduced energy consumption, lower carbon footprints, and more environmentally responsible software.
- Eco-Jedi Tools: Explore the tools and techniques at the heart of Green Software Development, including energy-efficient coding practices and sustainable development methodologies.
- Carbon Emissions and the Dark Side: Learn about the environmental impact of software and how we can combat the "Dark Side" of excessive energy consumption with eco-conscious programming.
- Ewoks vs. Energy Efficiency: Are you building your software like the energy-efficient Ewoks or the resource-hungry Death Star?
- The Path to a Greener Future: We'll discuss the challenges and opportunities ahead on our journey toward a more sustainable software galaxy and how you can be a part of it.
Join me for an engaging and informative presentation where we combine the power of technology and the wisdom of the Jedi to bring balance to the software development Force. Together, we'll ensure that the code is green, and our planet is preserved for generations to come. May the Green Code Be with You!
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...John Gallagher
Rails apps can be a black box. Have you ever tried to fix a bug where you just can’t understand what’s going on? This talk will give you practical steps to improve the observability of your Rails app, taking the time to understand and fix defects from hours or days to minutes. Rails 8 will bring an exciting new feature: built-in structured logging. This talk will delve into the transformative impact of structured logging on fixing bugs and saving engineers time. Structured logging, as a cornerstone of observability, offers a powerful way to handle logs compared to traditional text-based logs. This session will guide you through the nuances of structured logging in Rails, demonstrating how it can be used to gain better insights into your application’s behavior. This talk will be a practical, technical deep dive into how to make structured logging work with an existing Rails app.
I talk about the Steps to Observable Software - a practical five step process for improving the observability of your Rails app.
Trawex provides Amadeus Travel API is a collection of APIs that allow travel organizations to access Amadeus' various travel-related products and content. This includes the ability to search for flights, book flights, get hotel information, and view destination content. With the Amadeus API, travel agents and agencies can serve travelers globally, help them find the best deals, and manage their travel businesses, reducing costs and increasing revenues.
For more details, Pls visit our website:
https://www.trawex.com/amadeus-travel-api.php
How to Secure Your Kubernetes Software Supply Chain at ScaleAnchore
Achieving comprehensive security visibility in Kubernetes environments is essential for maintaining robust and compliant cloud-native applications. In this exclusive webinar, Anchore and Spectro Cloud team up to showcase how to enhance your Kubernetes security posture with SBOM (Software Bill of Materials) management and vulnerability scanning.
Join Cornelia Davis, VP of Product, Spectro Cloud and Alan Pope, Director of Developer Relations, Anchore to learn how to elevate your Kubernetes security visibility and protect your cloud-native applications effectively.
—Discover how Anchore can be integrated with Spectro Cloud Palette to take SBOM scanning to the next level, delivering fully automated software compliance
—Gain valuable insights into best practices for securing your Kubernetes workloads, ensuring compliance, and improving your DevSecOps processes.
Innoit Labs - Flutter App Development Company In Hyderabad.pptxofficialinnoitlabs
Innoit Labs is a leading Flutter app development company in Hyderabad, we specialize in creating high-quality, cross-platform mobile applications that offer a seamless user experience. Our expert team leverages the power of Flutter to deliver visually stunning and performance-optimized apps tailored to your business needs. With a strong focus on innovation and customer satisfaction, we help businesses in Hyderabad and beyond transform their ideas into successful mobile solutions. Choose us for reliable, efficient, and scalable Flutter app development services.
7. Nuvola
scuoladigitale.info
● > 3M HTTP requests / day
● > 1000 databases
● ~ 0.5T mysql data
● ~ 180M query / day
● ~ 105M of media files
● ~ 18T of media files
● From ~5k to ~200k sessions in 5 minutes
8. Scalability
Your app is scalable if it can adapt to
support an increasing amount of data
or a growing number of users.
9. “But… I don’t have an increasing load”
(http://www.freepik.com/free-photos-vectors/smile - Smile vector designed by Freepik)
10. “Scalability doesn’t matter to you.”
(http://www.freepik.com/free-photos-vectors/smile - Smile vector designed by Freepik)
12. “I do have an increasing load”
(http://www.freepik.com/free-photos-vectors/smile - Smile vector designed by Freepik)
29. 6 main areas
1. web server
2. sessions
3. database
4. filesystem
5. async tasks
6. logging
There are some more (http caching, frontend, etc): next talk!
36. Web server / Cache
PHP CACHE
APPLICATION CACHE
DOCTRINE CACHE
37. Web server / PHP cache
OPcache
OPcache improves PHP performance by storing precompiled script bytecode
in shared memory, thereby removing the need for PHP to load and parse
scripts on each request.
http://php.net/manual/en/intro.opcache.php
39. Web server / PHP cache
OPcache
Bytecode caching
opcache.enable = On
opcache.validate_timestamps = 0
Need to manually reset OPcache on deploy!
https://tideways.io/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises
40. PHP code / Application cache
● Put application cache in ram
● Use cache warmers during deploy
releaseN/var/cache -> /var/www/project/cache/releaseN
“/etc/fstab”
tmpfs /var/www/project/cache tmpfs size=512m
41. PHP code / Doctrine cache
● Configure Doctrine to use cache
● Disable Doctrine logging and profiling on prod
doctrine.orm.default_metadata_cache:
type: apcu
doctrine.orm.default_query_cache:
type: apcu
doctrine.orm.default_result_cache:
type: apcu
44. PHP code / Profiling
Blackfire
New Relic
Tideways
47. PHP code / Recap
● Easy
● No need to change your PHP code
● It’s most configuration and tuning
● You can do one by one and measure how it affects performance
● Need to monitor and profile: New Relic for PHP
● Don’t waste time on micro-optimization
Take away: use cache!
48. Sessions
● Think session management as a service
● Use centralized Memcached or Redis (Ec2
or ElasticCache on AWS)
● Avoid sticky sessions (load balancer set up)
49. Session / Memcached
No bundle required
https://labs.madisoft.it/scaling-symfony-sessions-with-memcached
54. Session / Recap
● Very easy
● No need to change your PHP code
● Redis better than Memcached: it has persistence and many other features
● Let AWS scale for you and deal with failover and sysadmin stuff
Take away: use Redis
62. Database / Big db problems
● Very slow backup. High lock time
● If mysql crashes, restart takes time
● It takes time to download and restore in dev
● You need expensive hardware (mostly RAM)
63. Database / Short-term solutions
Use a managed db service like AWS RDS
● It scales for you
● It handles failover and backup for you
But:
● It’s expensive for big db
● Problems are only mitigated but they are still there
66. Database / Sharding
● Very fast backup. Low lock time
● If mysql crashes, restart takes little time
● Fast to download and restore in dev
● No need of expensive hardware
● You arrange your dbs on many machines
67. Database / Sharding
● How can Symfony deal with them?
● How to execute a cli command on one of them?
● How to apply a migration (ie: add column) to 1000 dbs?
● …...
69. Database / Sharding
Define a DBAL connection and a ORM
entity manager for each db
https://symfony.com/doc/current/doctrine/multiple_entity_managers.html
73. Database / Doctrine sharding
● Suited for multi-tenant applications
● Global database to store shared data (ie: user data)
● Need to use uuid
http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/sharding.html
75. Database / Sharding
ShardManager Interface
$shardManager = new PoolingShardManager();
$currentCustomerId = 3;
$shardManager->selectShard($currentCustomerId);
// all queries after this call hit the shard where customer
// with id 3 is on
$shardManager->selectGlobal();
// the global db is selected
76. Database / Sharding
● It works but it’s complex to be managed
● No documentation everywhere
● Need to manage shard configuration: adding a new
shard?
● Need to parallelize shard migrations: Gearman?
● Deal with sharding in test environment
77. Database / Recap
● NOSQL is not used to scale SQL: they have different purposes. You can
use both.
● Sharding is difficult to implement
● Need to change your code
● Short-term solution is to use AWS to leverage some maintenance
● Doctrine ORM sharding works well but you need to write code and
wrappers. Best suited for multi-tenant apps
● When it’s done, you can scale without any limit
Take away: do sharding if your REALLY need it
85. Filesystem / Recap
● Easy
● Need to change your PHP code
● Ready-made bundles
● Avoid local filesystem and NAS
Take away: use FlystemBundle with S3
93. RabbitMQ
Putting some machines (containers) inside an
auto-scaling group!
They can scale based on:
● Hardware parameters: cpu / memory
● Number of queue items
● Add your custom metrics!
94. Async tasks / Recap
● You need an external system and some new machines / containers
● Need to change your PHP code
● Ready-made bundles and libraries
● Avoid blocking sync tasks. Put the message on the queue and move on.
Take away: use RabbitMQ with auto-scaling
consumers
97. Logging
● You need an external system
● Take a look at managed ones: loggly.com, logz.io, scalyr.com
● Don’t need to change your PHP code
● You can’t avoid it in a distributed system
Take away: use a managed service
98. Scaling / Recap
● Sessions and filesystem: easy. Do it
● PHP code: not difficult. Think of it. Save money.
● Database: very hard. Think a lot
● Async tasks: think of it if you have many of them.
● Logging: necessary. Easy to implement if you choose a
managed service