The document is a presentation on high performance PHP. It discusses profiling PHP applications to identify bottlenecks, code-level optimizations that can provide gains, and big wins like upgrading PHP versions and using APC correctly. It also covers load testing tools like JMeter and key takeaways like focusing on big wins and caching.
Today's high-traffic web sites must implement performance-boosting measures that reduce data processing and reduce load on the database, while increasing the speed of content delivery. One such method is the use of a cache to temporarily store whole pages, database recordsets, large objects, and sessions. While many caching mechanisms exist, memcached provides one of the fastest and easiest-to-use caching servers. Coupling memcached with the alternative PHP cache (APC) can greatly improve performance by reducing data processing time. In this talk, Ben Ramsey covers memcached and the pecl/memcached and pecl/apc extensions for PHP, exploring caching strategies, a variety of configuration options to fine-tune your caching solution, and discusses when it may be appropriate to use memcached vs. APC to cache objects or data.
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
Apache's configuration files can be used to configure how Apache operates, but they can also be used to configure PHP and how Apache httpd interacts with PHP. In this talk, Jeff explains the different ways Apache can be configured, explains many of the useful config options available for Apache modules, including our own mod_php, and showcases example of how they can be used with, and instead of, your PHP code.
Today's high-traffic web sites must implement performance-boosting measures that reduce data processing and reduce load on the database, while increasing the speed of content delivery. One such method is the use of a cache to temporarily store whole pages, database recordsets, large objects, and sessions. While many caching mechanisms exist, memcached provides one of the fastest and easiest-to-use caching servers. Coupling memcached with the alternative PHP cache (APC) can greatly improve performance by reducing data processing time. In this talk, Ben Ramsey covers memcached and the pecl/memcached and pecl/apc extensions for PHP, exploring caching strategies, a variety of configuration options to fine-tune your caching solution, and discusses when it may be appropriate to use memcached vs. APC to cache objects or data.
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
Apache's configuration files can be used to configure how Apache operates, but they can also be used to configure PHP and how Apache httpd interacts with PHP. In this talk, Jeff explains the different ways Apache can be configured, explains many of the useful config options available for Apache modules, including our own mod_php, and showcases example of how they can be used with, and instead of, your PHP code.
In this last years a lot of high traffic web sites have been built in PHP. One of the main problem to design a distributed PHP architecture is how to share session data between multiple servers. In this presentation we showed the most used solutions to scale a PHP application along multiple servers. We presented different solutions to share session data using open source solutions (nfs, databases, memcached, redis, etc). Moreover we talk about Zend Server Cluster Manager, an enterprise ready Web Application Server for running and managing an HA Cluster of PHP servers.
Caching and tuning fun for high scalability @ FOSDEM 2012Wim 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.
Caching and tuning fun for high scalability @ phpBenelux 2011Wim Godden
Slides for "Caching and Tuning fun for high scalability" talk, given @ phpBenelux Conference - Jan 28, 2011
Note that a lot of things were explained with each slide... that content is ofcourse not in the slides, so it might make some slides very unclear.
Caching and tuning fun for high scalability @ PHPTourWim 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. In this tutorial, we'll start from a Zend Framework based site. We'll add caching, begin to add servers and replace the standard LAMP stack, all while performing live benchmarks.
It's no denying that rich Javascript applications (sometimes called One Page Applications) are a big thing, but what if you want to leverage Drupal on the backend, or have an existing site? Tools like Angular.JS and EmberJS are great when you have an API, but Drupal 7 doesn't really have an API layer. I'll explore the parts of a one page application and how to integrate it into either an existing or a new Drupal site, and the pitfalls that one must watch out for.
You know how HTTP caching works but need more? In this talk we look into ways to cache personalized content. We will look at Edge Side Includes (ESI) to tailor caching rules of fragments, and at the user context concept to differentiate caches not by individual user but by permission groups.
In this presentation, I show the audience how to implement HTTP caching best practices in a non-intrusive way in PHP Symfony 4 code base.
This presentation focuses on topics like:
- Caching using cache-control headers
- Cache variations using the Vary header
- Conditional requests using headers like ETag & If-None-Match
- ESI discovery & parsing using headers like Surrogate-Capability & Surrogate-Control
- Caching stateful content using JSON Web Token Validation in Varnish
More information about this presentation is available at https://feryn.eu/speaking/developing-cacheable-php-applications-php-limburg-be/
Slides from the eZ Global Partner Conference 2012 (LISBON, PORTUGAL)
Advanced & spicy details about the eZ Publish Caching mechanisms : ini cache, compiled templates, viewcache, template-block caches...
More information about this HTTP caching talk can be found on https://feryn.eu/speaking/leverage-http-to-deliver-cacheable-websites-codemotion-rome-2018/
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
Challenges when building high profile editorial sitesYann Malet
This talk will be a walk through the challenges encountered when building a high profile editorial sites. My goal is to present some of the common pitfalls we have encountered at Lincoln Loop and to explain how we solved:
* Legacy migration always take longer
* devops
* Multiple environment
* Easy deployment
* Responsive design impacts the backend
* Journey of an image
* Picturefill.js
* Danger of reusing published django applications
* Caching strategy
* Html fragment
* Varnish
Audience Decision maker that are going to rebuild their magazine Developer bidding for this kind of projects for the first time
PHP Optimization can increase a client’s site performance and leverage your plugin design and capacity. Writing your code with PHP in mind first will help you build stable scalable plugins and applications. It will also save you time and energy after product release. Practical tips will be shared in this session for you to implement in projects immediately. Yes, there will be code.
In this last years a lot of high traffic web sites have been built in PHP. One of the main problem to design a distributed PHP architecture is how to share session data between multiple servers. In this presentation we showed the most used solutions to scale a PHP application along multiple servers. We presented different solutions to share session data using open source solutions (nfs, databases, memcached, redis, etc). Moreover we talk about Zend Server Cluster Manager, an enterprise ready Web Application Server for running and managing an HA Cluster of PHP servers.
Caching and tuning fun for high scalability @ FOSDEM 2012Wim 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.
Caching and tuning fun for high scalability @ phpBenelux 2011Wim Godden
Slides for "Caching and Tuning fun for high scalability" talk, given @ phpBenelux Conference - Jan 28, 2011
Note that a lot of things were explained with each slide... that content is ofcourse not in the slides, so it might make some slides very unclear.
Caching and tuning fun for high scalability @ PHPTourWim 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. In this tutorial, we'll start from a Zend Framework based site. We'll add caching, begin to add servers and replace the standard LAMP stack, all while performing live benchmarks.
It's no denying that rich Javascript applications (sometimes called One Page Applications) are a big thing, but what if you want to leverage Drupal on the backend, or have an existing site? Tools like Angular.JS and EmberJS are great when you have an API, but Drupal 7 doesn't really have an API layer. I'll explore the parts of a one page application and how to integrate it into either an existing or a new Drupal site, and the pitfalls that one must watch out for.
You know how HTTP caching works but need more? In this talk we look into ways to cache personalized content. We will look at Edge Side Includes (ESI) to tailor caching rules of fragments, and at the user context concept to differentiate caches not by individual user but by permission groups.
In this presentation, I show the audience how to implement HTTP caching best practices in a non-intrusive way in PHP Symfony 4 code base.
This presentation focuses on topics like:
- Caching using cache-control headers
- Cache variations using the Vary header
- Conditional requests using headers like ETag & If-None-Match
- ESI discovery & parsing using headers like Surrogate-Capability & Surrogate-Control
- Caching stateful content using JSON Web Token Validation in Varnish
More information about this presentation is available at https://feryn.eu/speaking/developing-cacheable-php-applications-php-limburg-be/
Slides from the eZ Global Partner Conference 2012 (LISBON, PORTUGAL)
Advanced & spicy details about the eZ Publish Caching mechanisms : ini cache, compiled templates, viewcache, template-block caches...
More information about this HTTP caching talk can be found on https://feryn.eu/speaking/leverage-http-to-deliver-cacheable-websites-codemotion-rome-2018/
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
Challenges when building high profile editorial sitesYann Malet
This talk will be a walk through the challenges encountered when building a high profile editorial sites. My goal is to present some of the common pitfalls we have encountered at Lincoln Loop and to explain how we solved:
* Legacy migration always take longer
* devops
* Multiple environment
* Easy deployment
* Responsive design impacts the backend
* Journey of an image
* Picturefill.js
* Danger of reusing published django applications
* Caching strategy
* Html fragment
* Varnish
Audience Decision maker that are going to rebuild their magazine Developer bidding for this kind of projects for the first time
PHP Optimization can increase a client’s site performance and leverage your plugin design and capacity. Writing your code with PHP in mind first will help you build stable scalable plugins and applications. It will also save you time and energy after product release. Practical tips will be shared in this session for you to implement in projects immediately. Yes, there will be code.
Scaling a High Traffic Web Application: Our Journey from Java to PHP120bi
What makes an application scale? What should you worry about early on and what can wait?
Over the last 3 years, Achievers has learned many lessons and gained fundamental knowledge on scaling our SaaS platform. CTO Dr. Aris Zakinthinos will present and discuss the decisions we’ve made including language choice, server architecture, and much more; join us while we share tips, tricks, and things to absolutely avoid.
Throughout the evening you will have the opportunity to talk to the development team behind the Achievers Platform and ask questions on scaling best practices.
This presentation covers some techniques for improving performance, as well as some business metrics around performance that Etsy has gathered recently.
The 10 minute opening talk for the Rendering Performance panel at Edge NY, September 23rd 2013. This was just designed to give a brief overview of the topic before the Q&A portion of the panel.
I gave this talk at Velocity NY 2013, and it covers the installation and use of a private WebPagetest instance, as well as the open source tool wpt-script which Etsy built.
Talk by Jonathan Oxer at Open Source Developers Conference 2004 about writing high-performance and scalable PHP applications. Originally presented 2004-12-02. More information at http://jon.oxer.com.au/talks/id/11
High Performance Php My Sql Scaling TechniquesZendCon
This talk will discuss issues and solutions when attempting to scale PHP and MySQL to high volume websites (such as digg.com). It will discuss some of the problems at hand, and go into (at a high level) some of the solutions, such as using memcache, DB partitioning, etc. As well as how to handle these solutions within PHP.
s React.js a library or a framework? In any case, it is a new way of working that represents a revolution in the way of building web projects. It has very particular characteristics that allow us, for instance, to render React code from the server side, or to include React components from Twig tags. During this talk we will present React.js, we will explore how to take advantage of it from PHP projects and we will give answers to practical problems such as universal (isomorphical) rendering and the generation of React.js forms from Symfony forms without duplication of efforts.
PHP UK 2017 - Don't Lose Sleep - Secure Your RESTAdam Englander
Are you worried that your REST API may be the next victim of an attack by ruthless hackers? Don't fret. Utilizing the same standards implemented by OAuth 2.0 and OpenID Connect, you can secure your REST API. Open and proven standards are the best ways to secure your REST APIs for now and well into the future. JSON Object Signing and Encryption (JOSE) is the core of a truly secure standards based REST API. In this talk, you will learn how to use the components of JOSE to secure your REST API for now and the future.
How Slow Load Times Hurt Your Bottom Line (And 17 Things You Can Do to Fix It)Tammy Everts
There are many compelling arguments why companies need to care about serving faster web pages to their users. Countless studies have found an irrefutable connection between load times and key performance indicators ranging from page views to revenue. This talk covers the reasons why you need to care about web performance and what you can do to make your pages faster.
This is episode 4 of the building the perfect PHP app for the enterprise webinar series. Nothing is faster than a frustrated user clicking away from your site or abandoning your service. Avoid attrition by learning how to tune your applications towards lightning-fast page loads and response times. Learn: the basic principles behind enterprise PHP performance management; How to optimize workloads through background jobs and caching; How to measure performance and make data-driven decisions.
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Fwdays
Доклад будет посвящён принципам построения высокомаштабируемых приложений на PHP! Множество докладчиков зацикливаются на вопросах производительности “чтения”.
Думаю многие из вас знают: если что-то “тормозит” - включаем кеширование, если что-то “глючит” - выключаем кеширование. Каждый знает, если поставить Memcache перед БД и Varnish после php-fpm, можно добиться отличных результатов в производительности. А если и этого не хватает - тогда можно два, три, четыре Varnish-а…
Но что же делать при интенсивном использовании системы на “запись”? Что делать когда входящих данных много или очень много? Как выглядит Data Processing на PHP? Когда нужно из одного сервера делать два? Когда “умирает”" rabbitmq и нужна kafka? Где заканчивается MySQL и начинается MongoDB? Каким образом система должна эволюционировать? Как от одного состояния переходить в другое и как трансформировать количество в новое качество? Что такое c10k problem? Что происходит при 10000 req/sec? А при 100000 req/sec?
The 5 most common reasons for a slow WordPress site and how to fix them – ext...Otto Kekäläinen
Presentation given in WP Meetup in October 2019.
Includes fresh new tips from summer/fall 2019!
A Must read for all WordPress site owners and developers.
What is Nginx and Why You Should to Use it with Wordpress HostingWPSFO Meetup Group
Floyd Smith and the team from NGINX presented at the Wordpress San Francisco MeetUp group in June 2016. In this presentation, he illustrated how NGINX can vastly improve your Wordpress hosting performance.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Northeast PHP - High Performance PHP
1. August 11th, 2012
High Performance PHP
Northeast PHP 2012
Jonathan Klein
jonathan.n.klein@gmail.com
@jonathanklein
2. Agenda
Who am I?
Why Performance Matters
Profiling PHP Applications
Code Level Optimizations
Big Wins
Load Testing
Takeaways
3. Introduction
• Web Performance Platform Lead at Wayfair
• Boston Web Performance Meetup Group Organizer
• Led a team that converted most of Wayfair’s storefront
codebase from Classic ASP to PHP.
1. Rewrote ~100,000 lines of code
• Wayfair Stats:
1. 450 reqs/sec for dynamic content (PHP pages)
2. 1600 reqs/sec for static content (including CDN)
3. Codebase has > 400,000 lines of PHP (some is 3rd party)
3
16. Graphite
• Written by Orbitz
• Real-time graphing engine for StatsD data (among other things)
• http://graphite.wikidot.com/
• Architecture: http://www.aosabook.org/en/graphite.html
16
17.
18.
19.
20. Xdebug
• PHP extension (need to install) - http://xdebug.org/
• Code level tracing
1. Exposes hotspots
• Significant overhead, use in DEV only!
• Add ?XDEBUG_PROFILE=true to a URL
• View results:
1. kcachegrind on linux
2. wincachegrind on Windows
20
27. Writing Efficient PHP
• Set max value before loop:
$max = count($rows);
for ($i = 0; $i < $max; $i++) {
echo $i;
}
• require_once() is slow
• Minimize use of define()
• Yes, single quotes are slightly faster than double
quotes
27
32. Writing Efficient PHP
• Set the max loop value before the loop:
$max = count($rows);
for ($i = 0; $i < $max; $i++) {
echo $i;
}
Okay, this one is pretty good
32
43. APC User Cache Optimizations
• Avoid fragmentation - keep utilization under 10%
1. Assign 1GB, only fill 100MB
• Compress objects that are > 10KB before storing
• Reduce garbage collection in the source of
apc_store()
• Consider CDB
1. http://engineering.wayfair.com/moving-constants-out-of-apc-and-into-cdb/
43
44. Caching
• Avoid hitting the database
• Cache in APC/Memcached
• 1:00 tomorrow: “Caching With Memcached”
44
45. Fix All Errors
• PHP 5.3: E_ALL | E_STRICT
• PHP 5.4: E_ALL
• Can also do error_reporting(-1);
45
46. Child Processes
• 4-6 processes per CPU core.
• Beyond that just add servers.
(Test your app)
46
47. HipHop for PHP
• Developed/Open Sourced by Facebook
• Transforms PHP source code into highly optimized C++
• Reduces CPU for Facebook’s servers by 50%
http://developers.facebook.com/blog/post/2010/02/02/hiphop-for-php--move-fast/
https://github.com/facebook/hiphop-php
47
49. JMeter
• Open Source
• Generate load via a GUI or command line
• Can watch req/s peak out
• Easy to use (just make sure you set the
correct path to Java on your computer).
49
50.
51.
52.
53.
54.
55. Be Careful
• JMeter looks a lot like a DOS attack
• Make sure you know what is failing
• Look at monitoring while test is running
• Run in Production
• Run a test, make a change, run it again
55
59. Why is it terrible?
• Lack of context
• Are we talking about average or a percentile?
• Server side time or client?
• Who is measuring it?
• When is it being measured?
• Real users or synthetic?
59
61. Pick Tight SLAs
“The homepage of our site will load in
<300ms at the 80th percentile, measured
by sampling 10% of our real users over a
24 hour period every day at 8AM.”
61
62. Pick Tight SLAs
“The homepage of our site will load in
<300ms at the 80th percentile, measured
by sampling 10% of our real users over a
24 hour period every day at 8AM.”
62
63. Things to Remember
1. Measure and monitor your application
2. Focus on big wins
3. Run the latest (stable) version of PHP
4. Make sure you are using APC correctly
5. It’s always the database: go to “The Proper Care
and Feeding of a MySQL Database” talk
6. Caching is your friend: go to the “Caching With
Memcached” talk
7. Know what system resources you depend on
63