SlideShare a Scribd company logo
1 of 49
Download to read offline
SCALING
WITH SYMFONY

+

=

PHP UK CONFERENCE 2014
HELLO PHPUK!
•

Ricard Clau, born and grown up in Barcelona, Spain

•

Software engineer at Hailo London

•

Symfony2 lover and PHP believer

•

Open-source contributor, sometimes I give talks

•

Twitter @ricardclau / Gmail ricard.clau@gmail.com
WHY THIS TALK?
•

Lots of PHP haters these days. I just don´t get it.

•

Some misconceptions about full-stack PHP frameworks

•

PHP is absolutely fine for most of your applications

•

But at some point you may need to replace some bits

•

DragonCity - Social game - 7.5M DAU - Symfony
AGENDA
•

Performance and scalability

•

Profiling and optimization

•

Storage: SQL vs NoSQL

•

Symfony2 is fast enough! Seriously!

•

Some war stories!

•

Almost everything applies to all PHP projects
Millions of
Users
Worldwide
24x7x365

CONCEPTS
Scalability, Availability, Load Balancing, Sharding
SCALABILITY
Which model would you choose?
AVAILABLE 24X7X365
We need to recover fast from any failure
LOAD BALANCING
It allows you to make changes without stopping your app
SHARDING
Luckily, you will get to a point when you need to do it...
And it can hurt if you have never considered it!
DON´T IF NOT NEEDED
•

Avoid premature optimizations

•

Microoptimizations are completely useless

•

Focus on impacting things

•

Incremental improvements

•

If the business is not working, it will be useless
BUT ACTIVELY PREVENT RISKS
•

Monitor servers: Ram, CPUs, Disk, network, idle
processes...

•

Try to engage stakeholders

•

When something surpasses half capacity, start
creating a B plan

•

Death of success is terrible
HANDS ON!
Where do we start from?
LOVE YOUR FRONTEND
Reduce # of requests and their size
SOME QUICK ADVICES
•

Fastest request -> No actual request

•

Icons in base64 inside your CSS

•

Minify CSS and JS, image size (jpegoptim, pngcrush, ...)

•

Use HTTP headers to cache at several layers

•

Network latency matters a lot

•

User experience takes benefit from all of these
SCALING PHP
Facebook, Wikipedia, Yahoo, Wordpress, Etsy, Zynga, YouPorn, Hailo,
Softonic, Emagister, Privalia, SocialPoint, Tuenti, ...
IS SCALING ACTUALLY EASY?
•

PHP bootstraps on every Request, so scaling is as “easy” as adding machines
behind a Load Balancer

•

But it makes it much slower than many other languages

•

Some things are shared among requests (sessions, storage, ...) but frameworks like
Symfony make it easier

•

PHP has been proof-tested in several BIG projects

•

Most of the times, problems are caused by the DB
LOOK BEYOND LAMP
•

Light-weight HTTP servers / CDNs for assets

•

Introduce reverse proxy cache like Varnish to cache pages (or ESI blocks)

•

Cache all the things (APC, Memcached, Redis, ...). 10 seconds cache -> Only 6
hits per minute!

•

RDBMS can deal with A LOT of data. But some problems are much better
solved with NoSQL databases

•

Sometimes other languages are more suitable for our problem
PHP PERFORMANCE
Opcode caches, composer, HHVM, quick wins
Upgrading from PHP5.3 will boost ~20-40%
APC: OUR OLD BESTIE
•

If you have ever worried about performance... you know it!

•

apc.stat -> Off (Apache reload to see changes)

•

apc.serializer -> igbinary (compact_strings -> Off)

•

apc.shm_size -> Check if 32Mb is enough

•

apc.write_lock -> Avoids cold cache issues

•

Check http://www.php.net/manual/en/apc.configuration.php
APC STATUS
http://svn.php.net/viewvc/pecl/apc/trunk/apc.php?view=markup
ZEND OPCACHE
•

Included in PHP5.5 standard distribution (valid with 5.2) will avoid weird
random issues like PHP5.4+APC

•

Better performance than APC in all tests

•

README https://github.com/zendtech/ZendOptimizerPlus

•

APC Userland Cache + Upload Hooks now live in APCU
(https://github.com/krakjoe/apcu)

•

Lots of companies are already using it!
OPCACHE STATUS
1 full-stack file, Rasmus style :)
(https://github.com/rlerdorf/opcache-status)
COMPOSER AUTOLOAD
•

You all already use Composer, right?

•

Default PSR-0 implementation is slow because we access
the FileSystem a lot

•

composer.phar install --optimize-autoloader (-o)
generates ClassMap

•

Same performance apc.stat = Off than
ApcUniversalClassLoader and less keys stored in APC
APC VS ZEND OPCACHE

http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-withsymfony2/
APC VS ZEND OPCACHE

http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-withsymfony2/
HHVM: THE FUTURE ENGINE?
•

Impressive progress in HHVM these past months

•

Most frameworks and libraries ~100% compatibility

•

Fewer memory, interesting speed improvements

•

We might finally have a language specification for PHP!

•

Specific HHVM features? -> Dangerous!

•

It will still not be comparable to compiled languages
FINE TUNING SYMFONY2
•

Disable unused bundles

•

SwiftMailer is quite slow, delegate to queue processes

•

If you can, use SubRequests with ESI and Varnish

•

Also check Twig C extension

•

You can implement a Cache Warmer for special needs

•

If using Apache, try app/console router:dump-apache
PROFILING
Diagnosing bottlenecks
PROFILING TOOLS
•

How often do you profile your code?

•

xDebug (Derick Rethans) and XHProf (Facebook)

•

Very convenient to install them in live servers and
activate to grab real data

•

Many things can also be discovered locally

•

Some tragedies only happen with live traffic
XHPROF (DEV VS PROD)
https://github.com/jonaswouters/XhprofBundle
HELLO WORLD
PHP and its frameworks...
Benchmarks comparing completely different things...
¿FRAMEWORKS == SLOW?
•

Some people think that writing their own
framework from scratch is a good idea

•

Also, that big frameworks use a lot of memory. (ZF1
and Symfony2 work with memory_limit 32M)

•

If this is your problem, PHP is not the solution

•

Don´t trust Hello World Performance Tests!

•

Nobody is better than a big community
TECHEMPOWER BENCHMARK
•

Symfony2 appears at the bottom

•

Comparison with light-weight frameworks is unfair.
Some incoherences (frameworks PHP >> PHP)

•

PHP will never be faster than a compiled language

•

In real apps, caching and DB optimizations equal things

•

Symfony2 roadmap improving performance
STORAGE
Use the right tool for the job. Silver bullets do not exist
RELATIONAL DBS
•

Mature technologies, good performance

•

Transactions: Atomicity, Consistency, Isolation, Durability

•

Foreign Keys, Joins, complex reporting queries

•

Millions of records without issues

•

We can use a NOSQLs key-value approach using
BLOB fields with serialized objects
NOSQL SOLUTIONS
•

Solutions to some concrete problems

•

CAP theorem (Consistency, Availability, Partition tolerance).
You can only get 2 of them... theoretically

•

Inmaturity in some of them. Complex to scale.

•

¿Big Data? 100M of records is NOT BIG DATA.

•

Redis, Cassandra, Riak and Solr work really well
QUEUE SYSTEMS
Read the docs, they are all completely different!
REAL-TIME DATA?
•

Try to delegate as much as possible to batch processes

•

Sending mails, external API requests, image
resizing, non-critical stats, ...

•

99% of stats don´t need to be real-time

•

60 seconds delay is mostly real-time!

•

Batch processes can be coded in different languages!
PHP NEEDS FRIENDS
Sometimes it is just not the best tool for our needs
PHP BAD SCENARIOS
•

24x7 running CLI daemon apps

•

Heavy math calculations, massive data processing,
programming contests

•

High concurrency apps with non-cachable requests

•

Threading, Forking, concurrent programming...

•

Writing DSLs
LOOK BEYOND PHP
•

JavaScript will be the king in the client side

•

In the server, Erlang and Go are growing adopters. And time will say about
Node.JS

•

Compiled languages like Go, C, C++ or Java will always be used in our stack.

•

JVM languages like Scala and Clojure are sexy now!

•

Learning other languages makes you a better engineer!
SYMFONY2
It is fast enough for most of what you want to do
WHY SYMFONY2?
•

Symfony2 is NOT the fastest “Hello world” framework...
but it is fast enough for most APIs and web applications

•

Big-community frameworks allow you to test any
technology in less than 5 minutes

•

A custom framework has usually higher costs and risks

•

LTS releases roadmap, stability, big projects are using it

•

Mature community, # of bundles
SOCIAL VIDEOGAME
https://apps.facebook.com/dragoncity/
(~7.5M DAU Facebook, iOS & Android Game)
DRAGONCITY: NUMBERS
•

~7.5 million daily users

•

~300 millions of registered users

•

Hundreds of millions of records for analytics generated daily

•

MySQL (32x2 + Analytics), Redis (~30), Cassandra (3)

•

HTTP requests are your progress -> No cacheable

•

Yes, most of the code is Symfony2! :)
POWERED BY SYMFONY2
@adanlobato showing happiness and pride!
6 DIGITS IN ANALYTICS
Yeah, still Symfony2! o/
WRAP-UP
•

PHP and Symfony2 work for most projects

•

Clever caching strategy is helpful

•

Profiling can make performance improve

•

The storage is almost always the bottleneck

•

Proper architecture design is crucial

•

PHP is not the best solution to some problems
QUESTIONS?
•

Twitter: @ricardclau

•

E-mail: ricard.clau@gmail.com

•

Github: https://github.com/ricardclau

•

Blog about PHP and Symfony2: http://www.ricardclau.com

•

Please, rate this talk at https://joind.in/talk/view/10697

More Related Content

What's hot

Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in ScalaAmir Karimi
 
What we talk about when we talk about DevOps
What we talk about when we talk about DevOpsWhat we talk about when we talk about DevOps
What we talk about when we talk about DevOpsRicard Clau
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Serverswebhostingguy
 
The Wix Microservice Stack
The Wix Microservice StackThe Wix Microservice Stack
The Wix Microservice StackTomer Gabel
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello WorldJosh Fischer
 
Apcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageApcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageDerek Collison
 
Travel with your mock server
Travel with your mock serverTravel with your mock server
Travel with your mock serverJorge Ortiz
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Tim Bunce
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)Panagiotis Kanavos
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time rebootKentaro Goto
 
Building real time applications with Symfony2
Building real time applications with Symfony2Building real time applications with Symfony2
Building real time applications with Symfony2Antonio Peric-Mazar
 
Gophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoGophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoAJ Bahnken
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the WildTomer Gabel
 
Ansible Best Practices - July 30
Ansible Best Practices - July 30Ansible Best Practices - July 30
Ansible Best Practices - July 30tylerturk
 

What's hot (19)

Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in Scala
 
What we talk about when we talk about DevOps
What we talk about when we talk about DevOpsWhat we talk about when we talk about DevOps
What we talk about when we talk about DevOps
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
 
The Wix Microservice Stack
The Wix Microservice StackThe Wix Microservice Stack
The Wix Microservice Stack
 
Streaming 101: Hello World
Streaming 101:  Hello WorldStreaming 101:  Hello World
Streaming 101: Hello World
 
MariaDB - The Future of MySQL?
MariaDB - The Future of MySQL?MariaDB - The Future of MySQL?
MariaDB - The Future of MySQL?
 
Apcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageApcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go language
 
Travel with your mock server
Travel with your mock serverTravel with your mock server
Travel with your mock server
 
Compression talk
Compression talkCompression talk
Compression talk
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (Greek)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (Greek)
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
 
Building real time applications with Symfony2
Building real time applications with Symfony2Building real time applications with Symfony2
Building real time applications with Symfony2
 
Gophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in GoGophers Riding Elephants: Writing PostgreSQL tools in Go
Gophers Riding Elephants: Writing PostgreSQL tools in Go
 
Mini-Training: Redis
Mini-Training: RedisMini-Training: Redis
Mini-Training: Redis
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Ansible Best Practices - July 30
Ansible Best Practices - July 30Ansible Best Practices - July 30
Ansible Best Practices - July 30
 

Viewers also liked

Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Ville Mattila
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsRaul Fraile
 
Starting with Symfony2
Starting with Symfony2Starting with Symfony2
Starting with Symfony2Kevin Bond
 
Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)Matthias Noback
 
A Practical Introduction to Symfony2
A Practical Introduction to Symfony2A Practical Introduction to Symfony2
A Practical Introduction to Symfony2Kris Wallsmith
 
Interoperability and Portability for Cloud Computing: A Guide
Interoperability and Portability for Cloud Computing: A GuideInteroperability and Portability for Cloud Computing: A Guide
Interoperability and Portability for Cloud Computing: A GuideCloud Standards Customer Council
 
Rationally boost your symfony2 application with caching tips and monitoring
Rationally boost your symfony2 application with caching tips and monitoringRationally boost your symfony2 application with caching tips and monitoring
Rationally boost your symfony2 application with caching tips and monitoringGiulio De Donato
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architectureDaniele D'Angeli
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersMarcin Chwedziak
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Innomatic Platform
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Ryan Weaver
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
Symfony2 and MongoDB
Symfony2 and MongoDBSymfony2 and MongoDB
Symfony2 and MongoDBPablo Godel
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Pablo Godel
 

Viewers also liked (17)

Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
Running a Scalable And Reliable Symfony2 Application in Cloud (Symfony Sweden...
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 Internals
 
Starting with Symfony2
Starting with Symfony2Starting with Symfony2
Starting with Symfony2
 
Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)
 
A Practical Introduction to Symfony2
A Practical Introduction to Symfony2A Practical Introduction to Symfony2
A Practical Introduction to Symfony2
 
Interoperability and Portability for Cloud Computing: A Guide
Interoperability and Portability for Cloud Computing: A GuideInteroperability and Portability for Cloud Computing: A Guide
Interoperability and Portability for Cloud Computing: A Guide
 
Rationally boost your symfony2 application with caching tips and monitoring
Rationally boost your symfony2 application with caching tips and monitoringRationally boost your symfony2 application with caching tips and monitoring
Rationally boost your symfony2 application with caching tips and monitoring
 
Extensible Data Modeling
Extensible Data ModelingExtensible Data Modeling
Extensible Data Modeling
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 Developers
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Code Review
Code ReviewCode Review
Code Review
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
Symfony2 and MongoDB
Symfony2 and MongoDBSymfony2 and MongoDB
Symfony2 and MongoDB
 
Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2Creating Mobile Apps With PHP & Symfony2
Creating Mobile Apps With PHP & Symfony2
 

Similar to Scaling with Symfony - PHP UK

Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opmisnull
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript DelusionJUGBD
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!netzwelt12345
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019graemerocher
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experienceAlex Tumanoff
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experienceIgor Anishchenko
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHPJohn Coggeshall
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to WorkSingleStore
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceJen Wei Lee
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?Barry Jones
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHPJonathan Klein
 
PHP - Programming language war, does it matter
PHP - Programming language war, does it matterPHP - Programming language war, does it matter
PHP - Programming language war, does it matterMizno Kruge
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...IncQuery Labs
 
From vagrant to production - Mark Eijsermans
From vagrant to production - Mark EijsermansFrom vagrant to production - Mark Eijsermans
From vagrant to production - Mark EijsermansDevopsdays
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishJani Tarvainen
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Alexey Rybak
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 

Similar to Scaling with Symfony - PHP UK (20)

Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opm
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript Delusion
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Ria Applications And PHP
Ria Applications And PHPRia Applications And PHP
Ria Applications And PHP
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital Workplace
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHP
 
PHP - Programming language war, does it matter
PHP - Programming language war, does it matterPHP - Programming language war, does it matter
PHP - Programming language war, does it matter
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
 
Stackato
StackatoStackato
Stackato
 
From vagrant to production - Mark Eijsermans
From vagrant to production - Mark EijsermansFrom vagrant to production - Mark Eijsermans
From vagrant to production - Mark Eijsermans
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 

More from Ricard Clau

NoEresTanEspecial-PulpoCon22.pdf
NoEresTanEspecial-PulpoCon22.pdfNoEresTanEspecial-PulpoCon22.pdf
NoEresTanEspecial-PulpoCon22.pdfRicard Clau
 
DevOps & Infraestructura como código: Promesas Rotas
DevOps & Infraestructura como código: Promesas RotasDevOps & Infraestructura como código: Promesas Rotas
DevOps & Infraestructura como código: Promesas RotasRicard Clau
 
DevOps Barcelona Conference 2018 - Intro
DevOps Barcelona Conference 2018 - IntroDevOps Barcelona Conference 2018 - Intro
DevOps Barcelona Conference 2018 - IntroRicard Clau
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP LondonRicard Clau
 
Escalabilidad y alto rendimiento con Symfony2
Escalabilidad y alto rendimiento con Symfony2Escalabilidad y alto rendimiento con Symfony2
Escalabilidad y alto rendimiento con Symfony2Ricard Clau
 
Betabeers Barcelona - Buenas prácticas
Betabeers Barcelona - Buenas prácticasBetabeers Barcelona - Buenas prácticas
Betabeers Barcelona - Buenas prácticasRicard Clau
 
Desymfony - Servicios
Desymfony  - ServiciosDesymfony  - Servicios
Desymfony - ServiciosRicard Clau
 

More from Ricard Clau (9)

devopsbcn23.pdf
devopsbcn23.pdfdevopsbcn23.pdf
devopsbcn23.pdf
 
devopsbcn22.pdf
devopsbcn22.pdfdevopsbcn22.pdf
devopsbcn22.pdf
 
NoEresTanEspecial-PulpoCon22.pdf
NoEresTanEspecial-PulpoCon22.pdfNoEresTanEspecial-PulpoCon22.pdf
NoEresTanEspecial-PulpoCon22.pdf
 
DevOps & Infraestructura como código: Promesas Rotas
DevOps & Infraestructura como código: Promesas RotasDevOps & Infraestructura como código: Promesas Rotas
DevOps & Infraestructura como código: Promesas Rotas
 
DevOps Barcelona Conference 2018 - Intro
DevOps Barcelona Conference 2018 - IntroDevOps Barcelona Conference 2018 - Intro
DevOps Barcelona Conference 2018 - Intro
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Escalabilidad y alto rendimiento con Symfony2
Escalabilidad y alto rendimiento con Symfony2Escalabilidad y alto rendimiento con Symfony2
Escalabilidad y alto rendimiento con Symfony2
 
Betabeers Barcelona - Buenas prácticas
Betabeers Barcelona - Buenas prácticasBetabeers Barcelona - Buenas prácticas
Betabeers Barcelona - Buenas prácticas
 
Desymfony - Servicios
Desymfony  - ServiciosDesymfony  - Servicios
Desymfony - Servicios
 

Recently uploaded

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 

Recently uploaded (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 

Scaling with Symfony - PHP UK

  • 2. HELLO PHPUK! • Ricard Clau, born and grown up in Barcelona, Spain • Software engineer at Hailo London • Symfony2 lover and PHP believer • Open-source contributor, sometimes I give talks • Twitter @ricardclau / Gmail ricard.clau@gmail.com
  • 3. WHY THIS TALK? • Lots of PHP haters these days. I just don´t get it. • Some misconceptions about full-stack PHP frameworks • PHP is absolutely fine for most of your applications • But at some point you may need to replace some bits • DragonCity - Social game - 7.5M DAU - Symfony
  • 4. AGENDA • Performance and scalability • Profiling and optimization • Storage: SQL vs NoSQL • Symfony2 is fast enough! Seriously! • Some war stories! • Almost everything applies to all PHP projects
  • 7. AVAILABLE 24X7X365 We need to recover fast from any failure
  • 8. LOAD BALANCING It allows you to make changes without stopping your app
  • 9. SHARDING Luckily, you will get to a point when you need to do it... And it can hurt if you have never considered it!
  • 10. DON´T IF NOT NEEDED • Avoid premature optimizations • Microoptimizations are completely useless • Focus on impacting things • Incremental improvements • If the business is not working, it will be useless
  • 11. BUT ACTIVELY PREVENT RISKS • Monitor servers: Ram, CPUs, Disk, network, idle processes... • Try to engage stakeholders • When something surpasses half capacity, start creating a B plan • Death of success is terrible
  • 12. HANDS ON! Where do we start from?
  • 13. LOVE YOUR FRONTEND Reduce # of requests and their size
  • 14. SOME QUICK ADVICES • Fastest request -> No actual request • Icons in base64 inside your CSS • Minify CSS and JS, image size (jpegoptim, pngcrush, ...) • Use HTTP headers to cache at several layers • Network latency matters a lot • User experience takes benefit from all of these
  • 15. SCALING PHP Facebook, Wikipedia, Yahoo, Wordpress, Etsy, Zynga, YouPorn, Hailo, Softonic, Emagister, Privalia, SocialPoint, Tuenti, ...
  • 16. IS SCALING ACTUALLY EASY? • PHP bootstraps on every Request, so scaling is as “easy” as adding machines behind a Load Balancer • But it makes it much slower than many other languages • Some things are shared among requests (sessions, storage, ...) but frameworks like Symfony make it easier • PHP has been proof-tested in several BIG projects • Most of the times, problems are caused by the DB
  • 17. LOOK BEYOND LAMP • Light-weight HTTP servers / CDNs for assets • Introduce reverse proxy cache like Varnish to cache pages (or ESI blocks) • Cache all the things (APC, Memcached, Redis, ...). 10 seconds cache -> Only 6 hits per minute! • RDBMS can deal with A LOT of data. But some problems are much better solved with NoSQL databases • Sometimes other languages are more suitable for our problem
  • 18. PHP PERFORMANCE Opcode caches, composer, HHVM, quick wins Upgrading from PHP5.3 will boost ~20-40%
  • 19. APC: OUR OLD BESTIE • If you have ever worried about performance... you know it! • apc.stat -> Off (Apache reload to see changes) • apc.serializer -> igbinary (compact_strings -> Off) • apc.shm_size -> Check if 32Mb is enough • apc.write_lock -> Avoids cold cache issues • Check http://www.php.net/manual/en/apc.configuration.php
  • 21. ZEND OPCACHE • Included in PHP5.5 standard distribution (valid with 5.2) will avoid weird random issues like PHP5.4+APC • Better performance than APC in all tests • README https://github.com/zendtech/ZendOptimizerPlus • APC Userland Cache + Upload Hooks now live in APCU (https://github.com/krakjoe/apcu) • Lots of companies are already using it!
  • 22. OPCACHE STATUS 1 full-stack file, Rasmus style :) (https://github.com/rlerdorf/opcache-status)
  • 23. COMPOSER AUTOLOAD • You all already use Composer, right? • Default PSR-0 implementation is slow because we access the FileSystem a lot • composer.phar install --optimize-autoloader (-o) generates ClassMap • Same performance apc.stat = Off than ApcUniversalClassLoader and less keys stored in APC
  • 24. APC VS ZEND OPCACHE http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-withsymfony2/
  • 25. APC VS ZEND OPCACHE http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-withsymfony2/
  • 26. HHVM: THE FUTURE ENGINE? • Impressive progress in HHVM these past months • Most frameworks and libraries ~100% compatibility • Fewer memory, interesting speed improvements • We might finally have a language specification for PHP! • Specific HHVM features? -> Dangerous! • It will still not be comparable to compiled languages
  • 27. FINE TUNING SYMFONY2 • Disable unused bundles • SwiftMailer is quite slow, delegate to queue processes • If you can, use SubRequests with ESI and Varnish • Also check Twig C extension • You can implement a Cache Warmer for special needs • If using Apache, try app/console router:dump-apache
  • 29. PROFILING TOOLS • How often do you profile your code? • xDebug (Derick Rethans) and XHProf (Facebook) • Very convenient to install them in live servers and activate to grab real data • Many things can also be discovered locally • Some tragedies only happen with live traffic
  • 30. XHPROF (DEV VS PROD) https://github.com/jonaswouters/XhprofBundle
  • 31. HELLO WORLD PHP and its frameworks... Benchmarks comparing completely different things...
  • 32. ¿FRAMEWORKS == SLOW? • Some people think that writing their own framework from scratch is a good idea • Also, that big frameworks use a lot of memory. (ZF1 and Symfony2 work with memory_limit 32M) • If this is your problem, PHP is not the solution • Don´t trust Hello World Performance Tests! • Nobody is better than a big community
  • 33. TECHEMPOWER BENCHMARK • Symfony2 appears at the bottom • Comparison with light-weight frameworks is unfair. Some incoherences (frameworks PHP >> PHP) • PHP will never be faster than a compiled language • In real apps, caching and DB optimizations equal things • Symfony2 roadmap improving performance
  • 34. STORAGE Use the right tool for the job. Silver bullets do not exist
  • 35. RELATIONAL DBS • Mature technologies, good performance • Transactions: Atomicity, Consistency, Isolation, Durability • Foreign Keys, Joins, complex reporting queries • Millions of records without issues • We can use a NOSQLs key-value approach using BLOB fields with serialized objects
  • 36. NOSQL SOLUTIONS • Solutions to some concrete problems • CAP theorem (Consistency, Availability, Partition tolerance). You can only get 2 of them... theoretically • Inmaturity in some of them. Complex to scale. • ¿Big Data? 100M of records is NOT BIG DATA. • Redis, Cassandra, Riak and Solr work really well
  • 37. QUEUE SYSTEMS Read the docs, they are all completely different!
  • 38. REAL-TIME DATA? • Try to delegate as much as possible to batch processes • Sending mails, external API requests, image resizing, non-critical stats, ... • 99% of stats don´t need to be real-time • 60 seconds delay is mostly real-time! • Batch processes can be coded in different languages!
  • 39. PHP NEEDS FRIENDS Sometimes it is just not the best tool for our needs
  • 40. PHP BAD SCENARIOS • 24x7 running CLI daemon apps • Heavy math calculations, massive data processing, programming contests • High concurrency apps with non-cachable requests • Threading, Forking, concurrent programming... • Writing DSLs
  • 41. LOOK BEYOND PHP • JavaScript will be the king in the client side • In the server, Erlang and Go are growing adopters. And time will say about Node.JS • Compiled languages like Go, C, C++ or Java will always be used in our stack. • JVM languages like Scala and Clojure are sexy now! • Learning other languages makes you a better engineer!
  • 42. SYMFONY2 It is fast enough for most of what you want to do
  • 43. WHY SYMFONY2? • Symfony2 is NOT the fastest “Hello world” framework... but it is fast enough for most APIs and web applications • Big-community frameworks allow you to test any technology in less than 5 minutes • A custom framework has usually higher costs and risks • LTS releases roadmap, stability, big projects are using it • Mature community, # of bundles
  • 45. DRAGONCITY: NUMBERS • ~7.5 million daily users • ~300 millions of registered users • Hundreds of millions of records for analytics generated daily • MySQL (32x2 + Analytics), Redis (~30), Cassandra (3) • HTTP requests are your progress -> No cacheable • Yes, most of the code is Symfony2! :)
  • 46. POWERED BY SYMFONY2 @adanlobato showing happiness and pride!
  • 47. 6 DIGITS IN ANALYTICS Yeah, still Symfony2! o/
  • 48. WRAP-UP • PHP and Symfony2 work for most projects • Clever caching strategy is helpful • Profiling can make performance improve • The storage is almost always the bottleneck • Proper architecture design is crucial • PHP is not the best solution to some problems
  • 49. QUESTIONS? • Twitter: @ricardclau • E-mail: ricard.clau@gmail.com • Github: https://github.com/ricardclau • Blog about PHP and Symfony2: http://www.ricardclau.com • Please, rate this talk at https://joind.in/talk/view/10697