Upgrade to Pro — share decks privately, control downloads, hide ads and more …

There will be PHP7 - Test in Production - Berli...

There will be PHP7 - Test in Production - Berlin Edition

How we migrated the Wikimedia infrastructure to PHP7 without most of you noticing!

effie mouzeli

November 04, 2019
Tweet

More Decks by effie mouzeli

Other Decks in Technology

Transcript

  1. There Will Be PHP7 Test in Production - Berlin 2019

    @manjiki giuseppe lavagetto • effie mouzeli
  2. 2

  3. MediaWiki ✺ Our core application ✺ PHP, Apache, MySQL. Yes.*

    ✺ Thick caching layer ✺ App servers cluster (Web) ✺ API cluster ✺ Jobrunners/Videoscalers cluster MediaWiki is a free server-based software, licensed under the GNU GPL. It is an extremely powerful, scalable software, and a feature-rich wiki implementation that uses PHP to process and display data stored in a database, such as MySQL. 3 * it’s complicated
  4. HHVM & PHP-FPM ✺ Hip Hop Virtual Machine (2014) ✴

    PHP5 and Hack ✴ JIT ✴ Performant ✺ PHP FastCGI Process Manager (2019) ✴ PHP7 Support ✴ Opcode Caching ✴ Performant HHVM is developed by Facebook and supports only the Hack programming language PHP-FPM is a community project and is PHP-FastCGI implementation with additional features 4 @manjiki
  5. Initial Preparations ✺ Install PHP-FPM ✺ Introduce PHP7 cookie ✺

    Browser extension ✺ Beta Users 5 ✺ CI ✺ Observability ✺ Cache slotting
  6. Initial Preparations ✺ Install PHP-FPM ✺ Introduce PHP7 cookie ✺

    Browser extension ✺ Beta Users 6 ✺ CI ✺ Observability ✺ Cache slotting
  7. Rolling out: Appservers ✺ 43 servers ✺ Control percentage of

    anon users getting the PHP7 cookie ✺ Pushed to ~20% ✺ Not all users accept cookies 8 Issue: Opcache corruptions :( @manjiki
  8. Rolling out: API servers ✺ 47 Servers ✺ A few

    API clients supported cookies ✺ Introduced php7_only feature flag ✺ Converted servers to PHP7 ✴ Each server serves ~2% of API traffic 9 Issue: This actually went well!
  9. Rolling out: Jobrunners ✺ 24 Servers ✺ Catalogued jobs ✺

    Migrated high traffic jobs ✺ Migrated lower traffic ones ✺ Enabled php7_only on all 10 Issue: This actually went well! @manjiki