InfrastrutturaHiphop for PHP     deploy   @ Hyves
Cosè Hyves?• Social network olandese• 5.5mln utenti attivi• 11mln utenti registrati• ~170mln pageview/giorno• 3500+ server...
Risorse• Storage• CPU• Database, database, database...• Cache• Network• Monitoring
Codice• PHP (3.5 MLOC, tanta roba)• Python• BASH• Java
Applicazioni• Sito web• Mobile (iPhone, Android)• Giochi• Ads• Hyvesmobile
Hiphop for PHP, cosè?•   Trasforma codice sorgente da PHP a C++•   Compilazione tramite GCC•   Reimplementazione completa ...
Subsystems• Runtime  o PHP types, operations and stuff• Compiler  o Turn PHP code into C++• Interpreter/eval   o Run PHP c...
Runtime (the basis)• Complete C++ reimplementation  C• How to make C++ behave as PHP?  o Heavy operator overloading  o Hea...
Compiler (architecture)
Execution models• Single execution  o Specify which "virtual file" to run• Webserver  o libevent + evhttp based  o thread-...
Neat stuff• Upgrade with 0 downtime  o Socket transfer over a unix socket• Memory manager  o Warm-up document• Paralleliza...
Hiphop dont• (100% - 99% compatible) * size of Hyves = lots of shit• No if (!class_exists(bla)) hyves_require_once(bla.php...
Deploy•   ~ 500 server••   Generazione “mainweb”••   Testing, testing, testing e... testing••   BitTorrent••   Attivazione...
Sveglia! Ho finito...                    Domande?                    Curiosità?marco.londero@linux.it ~ marco@hyves.nl ~ @...
Upcoming SlideShare
Loading in …5
×

Infrastructure, Hiphop for PHP, deploy @ Hyves

1,687 views

Published on

Brief introduction to Hyves' infrastructure, deploy system and Hiphop for PHP performance speedup

Published in: Technology
2 Comments
0 Likes
Statistics
Notes
  • Actually a friend asked me to have this talk for the PHP users group he's involved into... not velocityconf :) mix of italian/english slides (part of them copied from Lorenzo's presentation) created while flying back to my hometown... no worries, details have been discussed w/ Bo :)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • hey I never knew you made this :) 5 months ago (6)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
1,687
On SlideShare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
0
Comments
2
Likes
0
Embeds 0
No embeds

No notes for slide

Infrastructure, Hiphop for PHP, deploy @ Hyves

  1. 1. InfrastrutturaHiphop for PHP deploy @ Hyves
  2. 2. Cosè Hyves?• Social network olandese• 5.5mln utenti attivi• 11mln utenti registrati• ~170mln pageview/giorno• 3500+ server• 3 datacenter
  3. 3. Risorse• Storage• CPU• Database, database, database...• Cache• Network• Monitoring
  4. 4. Codice• PHP (3.5 MLOC, tanta roba)• Python• BASH• Java
  5. 5. Applicazioni• Sito web• Mobile (iPhone, Android)• Giochi• Ads• Hyvesmobile
  6. 6. Hiphop for PHP, cosè?• Trasforma codice sorgente da PHP a C++• Compilazione tramite GCC• Reimplementazione completa di PHP• Non proprio “brand new” (3+)• Grosso progetto (1 MLOC Vs. 3 MLOC di PHP)• Beta• “Fucking FAST!”
  7. 7. Subsystems• Runtime o PHP types, operations and stuff• Compiler o Turn PHP code into C++• Interpreter/eval o Run PHP code directly• Execution models o Webserver, single execution, libraries
  8. 8. Runtime (the basis)• Complete C++ reimplementation C• How to make C++ behave as PHP? o Heavy operator overloading o Heavy smart pointers o Heavy reference counting• = a nicer way to write core HPHP code and extensions!
  9. 9. Compiler (architecture)
  10. 10. Execution models• Single execution o Specify which "virtual file" to run• Webserver o libevent + evhttp based o thread-pool o service threads• Embedded library o C++, Java, Python
  11. 11. Neat stuff• Upgrade with 0 downtime o Socket transfer over a unix socket• Memory manager o Warm-up document• Parallelization o Parallel MySQL queries• Stat counters o Admin API
  12. 12. Hiphop dont• (100% - 99% compatible) * size of Hyves = lots of shit• No if (!class_exists(bla)) hyves_require_once(bla.php);• create_function is borderline• eval is borderline• HIPHOP constant
  13. 13. Deploy• ~ 500 server•• Generazione “mainweb”•• Testing, testing, testing e... testing•• BitTorrent•• Attivazione•• Go live
  14. 14. Sveglia! Ho finito... Domande? Curiosità?marco.londero@linux.it ~ marco@hyves.nl ~ @tmarcuz

×