SlideShare a Scribd company logo
1 of 28
Download to read offline
Symfony e grandi numeri
Si...può...fare!

Daniel Londero
daniel.londero@sth.it
Chi sono

Daniel Londero


➢   Sviluppatore PHP dal 2005 @

➢   (s|S)ymfony framework

➢   PUG Friuli

➢   Runner
2M
         500k
5M                       300k

       10k   10M
200k

             50k        100k
Calciomercato.com: la storia

➢   Nasce nel 1996

➢   Nel 2006 arriva in STH

➢   Nel 2010 si passa a symfony 1.4

➢   12 aprile 2010 revision 1

➢   10 giugno 2010: deploy (22 ore)
I numeri

               UTENTI UNICI   PAGINE VISTE
                 AL MESE        AL MESE


AGOSTO 2010      3,6M            36M

GENNAIO 2011     3,3M            32M

MARZO 2011       2,2M            28M
Perchè symfony?

➢   Opensource

➢   Community

➢   Documentato

➢   Test

➢   Best practice (MVC / DRY / KISS / ...)
#GAC
APPLICATION

                     LOAD BALANCER


MEMCACHED     MEMCACHED
                                                            BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC


                                                             DATA

         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
Scalare: orizzontale vs verticale

Orizzontale
➢ Aggiungo macchine

➢ Aumenta complessità

➢ Costi e rischi più bassi




Verticale
➢ Aggiungo risorse

➢ Bassa complessità

➢ Costi e rischi elevati
Gestione delle sessioni


➢   Balancer persistenti

➢   NFS (sconsigliato)

➢   Database

➢   Memcached (Redis dalla 2.4)
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
Cache storage system
➢   SfFileCache (default)

➢   SfAPCCache

➢   SfEAcceleratorCache

➢   SfMemcacheCache

➢   SfSQLiteCache

➢   sfXCacheCache
“There are only two hard things in Computer
Science: cache invalidation and naming things”
                                  - Phil Karlton
Cache pagina
Cache Partial e Component
Contatori

Sfruttare la velocità di accesso alla memoria per
sollevare i database da operazioni inutili.

➢   Impression sui banner

➢   Letture articoli

➢   Voti per i sondaggi
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
sfMasterSlavePlugin
all:
 master:
   class: sfDoctrineDatabase
   param:
     dsn:    mysql:dbname=database;host:master.example.com
     username: root
     password: ~
 slave:
   class: sfDoctrineDatabase
   param:
     dsn:    mysql:dbname=database;host:slave.example.com
     username: root
     password: ~

dev:
 master: &master
  class: sfDoctrineDatabase
  param:
    dsn:    mysql:dbname=database;host=localhost
    username: root
    password: ~
 slave: *master
Strumenti utili


➢   Web debug toolbar

➢   Slow query log

➢   Explain

➢   Live on stage (and dev)
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
LOAD BALANCER


MEMCACHED     MEMCACHED
                                                       BE
  NGINX 1       NGINX N
                                   NGINX 1   NGINX N
 PHP FCGI       PHP FCGI


   APC              APC



         LOAD BALANCER

                                               NFS
MASTER      SLAVE    ...   SLAVE
  DB         DB1            DBN
Credits e link
http://www.flickr.com/photos/theplanetdotcom/4879419788

http://www.php.net/manual/en/book.memcache.php

http://www.symfony-project.org/reference/1_4/en/05-Factories

http://www.symfony-project.org/gentle-introduction/1_4/en/12-Caching

http://www.symfony-project.org/jobeet/1_4/Doctrine/en/21

http://www.symfony-project.org/plugins/sfDoctrineMasterSlavePlugin

http://dev.mysql.com/doc/refman/5.6/en/slow-query-log.html

http://dev.mysql.com/doc/refman/5.6/en/explain.html
Grazie. Attendo feedback...


              Votate questo talk
              http://joind.in/3024



                Contattatemi
daniel.londero@sth.it | @dlondero | phpblog.it

More Related Content

What's hot

XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
voluntas
 

What's hot (20)

Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!
 
Gluster technical overview
Gluster technical overviewGluster technical overview
Gluster technical overview
 
GlusterD 2.0 - Managing Distributed File System Using a Centralized Store
GlusterD 2.0 - Managing Distributed File System Using a Centralized StoreGlusterD 2.0 - Managing Distributed File System Using a Centralized Store
GlusterD 2.0 - Managing Distributed File System Using a Centralized Store
 
Request-Oriented Durable Write Caching for Application Performance (USENIX AT...
Request-Oriented Durable Write Caching for Application Performance (USENIX AT...Request-Oriented Durable Write Caching for Application Performance (USENIX AT...
Request-Oriented Durable Write Caching for Application Performance (USENIX AT...
 
Object Compaction in Cloud for High Yield
Object Compaction in Cloud for High YieldObject Compaction in Cloud for High Yield
Object Compaction in Cloud for High Yield
 
Lcna tutorial-2012
Lcna tutorial-2012Lcna tutorial-2012
Lcna tutorial-2012
 
Sdc 2012-challenges
Sdc 2012-challengesSdc 2012-challenges
Sdc 2012-challenges
 
Scale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_glusterScale out backups-with_bareos_and_gluster
Scale out backups-with_bareos_and_gluster
 
Smb gluster devmar2013
Smb gluster devmar2013Smb gluster devmar2013
Smb gluster devmar2013
 
Developing apps and_integrating_with_gluster_fs_-_libgfapi
Developing apps and_integrating_with_gluster_fs_-_libgfapiDeveloping apps and_integrating_with_gluster_fs_-_libgfapi
Developing apps and_integrating_with_gluster_fs_-_libgfapi
 
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
 
Accelerate your web app with a layer of Varnish
Accelerate your web app with a layer of VarnishAccelerate your web app with a layer of Varnish
Accelerate your web app with a layer of Varnish
 
Gluster intro-tdose
Gluster intro-tdoseGluster intro-tdose
Gluster intro-tdose
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
 
[POSS 2019] OVirt and Ceph: Perfect Combination.?
[POSS 2019] OVirt and  Ceph: Perfect Combination.?[POSS 2019] OVirt and  Ceph: Perfect Combination.?
[POSS 2019] OVirt and Ceph: Perfect Combination.?
 
GlusterFs Architecture & Roadmap - LinuxCon EU 2013
GlusterFs Architecture & Roadmap - LinuxCon EU 2013GlusterFs Architecture & Roadmap - LinuxCon EU 2013
GlusterFs Architecture & Roadmap - LinuxCon EU 2013
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vosOSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
 
gRPC & Kubernetes
gRPC & KubernetesgRPC & Kubernetes
gRPC & Kubernetes
 
20160130 Gluster-roadmap
20160130 Gluster-roadmap20160130 Gluster-roadmap
20160130 Gluster-roadmap
 

Similar to Symfony e grandi numeri: si può fare!

drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015
Alexandre Huynh
 
Sharing experience implementing Direct NFS
Sharing experience implementing Direct NFSSharing experience implementing Direct NFS
Sharing experience implementing Direct NFS
Yury Velikanov
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloads
pittmantony
 

Similar to Symfony e grandi numeri: si può fare! (20)

Percon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshellPercon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshell
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
meetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypesmeetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypes
 
Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1
 
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&PierreKafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
Kafka on Pulsar:bringing native Kafka protocol support to Pulsar_Sijie&Pierre
 
Demo 0.9.4
Demo 0.9.4Demo 0.9.4
Demo 0.9.4
 
SLES 11 SP2 PerformanceEvaluation for Linux on System z
SLES 11 SP2 PerformanceEvaluation for Linux on System zSLES 11 SP2 PerformanceEvaluation for Linux on System z
SLES 11 SP2 PerformanceEvaluation for Linux on System z
 
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
Cross the streams thanks to Kafka and Flink (Christophe Philemotte, Digazu) K...
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoid
 
Application Caching: The Hidden Microservice
Application Caching: The Hidden MicroserviceApplication Caching: The Hidden Microservice
Application Caching: The Hidden Microservice
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Introducing Kafka-on-Pulsar: bring native Kafka protocol support to Apache Pu...
Introducing Kafka-on-Pulsar: bring native Kafka protocol support to Apache Pu...Introducing Kafka-on-Pulsar: bring native Kafka protocol support to Apache Pu...
Introducing Kafka-on-Pulsar: bring native Kafka protocol support to Apache Pu...
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015drbd9_and_drbdmanage_may_2015
drbd9_and_drbdmanage_may_2015
 
Sharing experience implementing Direct NFS
Sharing experience implementing Direct NFSSharing experience implementing Direct NFS
Sharing experience implementing Direct NFS
 
High Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go AssemblyHigh Performance Scaling Techniques in Golang Using Go Assembly
High Performance Scaling Techniques in Golang Using Go Assembly
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloads
 

More from Daniel Londero

More from Daniel Londero (10)

Magento meets vagrant
Magento meets vagrantMagento meets vagrant
Magento meets vagrant
 
Random Tips for Remote Working
Random Tips for Remote WorkingRandom Tips for Remote Working
Random Tips for Remote Working
 
REST in practice with Symfony2
REST in practice with Symfony2REST in practice with Symfony2
REST in practice with Symfony2
 
Rest in practice con Symfony2
Rest in practice con Symfony2Rest in practice con Symfony2
Rest in practice con Symfony2
 
Lavorare da casa: siamo pronti?
Lavorare da casa: siamo pronti?Lavorare da casa: siamo pronti?
Lavorare da casa: siamo pronti?
 
Symfony2, SQL e NoSQL. Assieme. Si può.
Symfony2, SQL e NoSQL. Assieme. Si può.Symfony2, SQL e NoSQL. Assieme. Si può.
Symfony2, SQL e NoSQL. Assieme. Si può.
 
Lavorare da casa: siamo pronti?
Lavorare da casa: siamo pronti?Lavorare da casa: siamo pronti?
Lavorare da casa: siamo pronti?
 
Io cache, tu database
Io cache, tu databaseIo cache, tu database
Io cache, tu database
 
Unit testing 101
Unit testing 101Unit testing 101
Unit testing 101
 
Enterprise Open Source: Il caso PHP
Enterprise Open Source: Il caso PHPEnterprise Open Source: Il caso PHP
Enterprise Open Source: Il caso PHP
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Symfony e grandi numeri: si può fare!