Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
InterConPHP 2014 - Scaling PHP
Search
Lucas Arruda
July 19, 2014
Technology
140
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
InterConPHP 2014 - Scaling PHP
Lucas Arruda
July 19, 2014
More Decks by Lucas Arruda
See All by Lucas Arruda
Drupal Day SP 2014 - Virtualize seu Ambiente e Seja Produtivo!
larruda
0
57
Other Decks in Technology
See All in Technology
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
190
Metadata - Section 1: HTML Basics
mohab1
0
120
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
500
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
230
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
Optunaの最新リリースv5.0について
pfn
PRO
0
120
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
470
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
First, design no harm
axbom
PRO
2
1.3k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
How GitHub (no longer) Works
holman
316
150k
Transcript
Scaling PHP Lucas Arruda
[email protected]
@lunascarruda Handrus Nogueira
[email protected]
@handrus
Lucas Arruda Software Architect @ CI&T Open-Source enthusiast ~10 yrs
on the road Based on Campinas-SP Zend Certified Engineer PHP 5.3 Drupaler for 4 yrs Google Cloud Platform Qualified Dev.
Handrus Software Architect / Dev @ Taller Open-Source and Agile
~10 yrs on the road Based on Bauru-SP/Florianópolis-SC Drupaler for 3 yrs
The Basics
Use the latest PHP stable version
Use the latest PHP stable version
Disable unnecessary PHP extensions and web-server modules • PHP extensions
consume memory heap • Some badly written can cause memory leaks • The same applies for web-server modules • Disable if you don’t need them!
Fine tune your php.ini! • memory_limit memory_get_usage() / memory_get_peak_usage() •
realpath_cache_size realpath_cache_get() • realpath_cache_ttl Max execution per thread - will affect memory usage!
mod_php vs. FastCGI vs. PHP-FPM
ob_flush() flush() ?
PHP ACCELERATORS
Alternative PHP Cache (APC) Zend OPcache XCache
APC OPcache XCache
None
Zephir
Scaling PHP Horizontally
Does your app use session data? No: you’re good to
go! Yes: then you’ll need to manage this data across multiple servers.
Sharing session data Fault tolerant No bottleneck Cheaper buut… it
needs architecure changes! Persistent load balancing Sharing session data PHP Session Management Persistent load balacing Single point of failure Bottleneck Expensive
Options Shared file-system Database Memcache / Redis session.name session.save_handler session.save_path
Sharing session data Handlers files user memcache
Avoid database specific queries. Good libraries can help (Doctrine FTW!)
If not possible Document like any Technical Debt!
And choose well your database!! • MySQL • MariaDB •
PerconaDB Version?!
None
How dependent of your actual environment are you? timezone paths
connection string limits timeouts Number of tries API Keys
Caching Mechanisms
APC for caching user data Memcache for key/value storage (URI/HTML?)
tmpfs/ramfs for all file-based caching
Reverse proxying Nginx Varnish
None
...
Q&A ciandt.com
THANKS FOR BEING HERE! Please evaluate this presentation! http://goo.gl/P8ZDfc (3
questions only)
@lunascarruda
[email protected]
google.com/+LucasArruda fb.com/lucasnarruda linkedin.com/in/larruda github.com/larruda coderbits.com/larruda @handrus
[email protected]
google.com/+HandrusNogueira
fb.com/handrus linkedin.com/in/handrus github.com/handrus coderbits.com/handrus