Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Large-scale websites performance optimisation t...

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

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 PHP foundation.

Georgiana Gligor

October 21, 2016
Tweet

More Decks by Georgiana Gligor

Other Decks in Technology

Transcript

  1. 2 ✤ Geek. Mother. Do-er. ✤ Crafting enterprise apps ✤

    Large-Scale Application Architect ✤ PHP Cluj Meetup Organiser ✤ Systems Engineering PhD Student Georgiana Gligor @gbtekkie [email protected]
  2. ✤ ultra low cost airline ✤ clever airports strategy ✤

    own reservation system (no GDS) ✤ selling models: site, call centre 5 THE CHALLENGE
  3. 23 Parallel PHP #2: PARALLELISM ✤ same good old cURL,

    but on steroids ✤ curl_init -> curl_multi_init ✤ async process multiple cURL handles
  4. 25 Fixture-based development #3: FIXTURES ✤ discuss contracts before actual

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

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

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

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

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

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