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

Large-scale websites performance optimisation tricks. Airline case study. @MusicCityCode

Large-scale websites performance optimisation tricks. Airline case study. @MusicCityCode

Practical lessons learned while revamping a US airline website to resist huge Black Friday and Cyber Monday traffic values. Using HTTP status codes and PHP cleverly, we have made parallel requests possible, so that the user experience is greatly enhanced, and we pre-cache resource-consuming user searches. All on a solid Symfony2 foundation.

Georgiana Gligor

August 19, 2016
Tweet

More Decks by Georgiana Gligor

Other Decks in Programming

Transcript

  1. 3 ✤ Geek. Mother. Do-er. ✤ Crafting enterprise- level apps

    ✤ on LAMP stack since 2003 ✤ Architecture and DevOps consultant ✤ PHP Cluj Meetup Organizer Georgiana Gligor
  2. ✤ ultra low cost airline ✤ clever airports strategy ✤

    own reservation system (no GDS) ✤ selling models: site, call centre 6 THE CHALLENGE
  3. ✤ polyglot technology stack • Java • LAMP ✤ geographically

    distributed teams • 10 timezones ✤ replace legacy monolith 9 CONSTRAINTS
  4. 19 Parallel PHP #2: PARALLELISM ✤ async process multiple cURL

    handles ✤ same good old cURL, but on steroids ✤ curl_multi
  5. 22 Fixture-based development #3: FIXTURES ✤ discuss contracts before actual

    coding ✤ eliminates problems early on ✤ developers work independently ✤ test components separately
  6. 23 #4: 204 TRICK ✤ HTTP status code 204 ✤

    success code ✤ Content-Length: 0 ✤ backend ack request and continues ✤ client can continue processing
  7. 27 #4: 204 TRICK public function batchProcess($data) { // 1

    - check permissions // 2 - validate user data }
  8. 28 #4: 204 TRICK public function batchProcess($data) { // 1

    - check permissions // 2 - validate user data // 3 - return 204 No Content }
  9. 29 #4: 204 TRICK public function batchProcess($data) { // 1

    - check permissions // 2 - validate user data // 3 - return 204 No Content // 4 - process batch }
  10. ✤ frontend (Drupal, Javascript SPAs) ✤ backend (PHP services) ✤

    cache 32 #5: SILOS 1 silo = full setup of servers that deliver the end-to-end functionality