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

Large-scale websites performance optimisation t...

Large-scale websites performance optimisation tricks @BucharestTechWeek

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

May 26, 2017
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 public function batchProcess($data) { // 1 - check permissions

    // 2 - validate user data // 3 - return 204 No Content // 4 - process batch } #4: 204 TRICK
  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
  10. 42 traffic controller silo 1 silo 3 silo 2 #5:

    SILOS 3rd party API content internal API
  11. 43 traffic controller variation A variation C variation B 3rd

    party API content internal API #5: SILOS
  12. 44 traffic controller variation A variation C variation B 3rd

    party API content internal API #5: SILOS redis memcache no cache
  13. 45 traffic controller variation A variation C variation B 3rd

    party API content internal API #5: SILOS v11.4.7 v11.4.7 v12.0.1
  14. 46 traffic controller variation A variation C variation B 3rd

    party API content internal API #5: SILOS v5.1.9 v5.2.0 v6.0.1