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

InterConPHP 2014 - Scaling PHP

InterConPHP 2014 - Scaling PHP

Avatar for Lucas Arruda

Lucas Arruda

July 19, 2014

More Decks by Lucas Arruda

Other Decks in Technology

Transcript

  1. Lucas Arruda Software Architect @ CI&T Open-Source enthusiast ~10 yrs

    on the road Based on Campinas-SP Zend Certified Engineer PHP 5.3 Drupaler for 4 yrs Google Cloud Platform Qualified Dev.
  2. Handrus Software Architect / Dev @ Taller Open-Source and Agile

    ~10 yrs on the road Based on Bauru-SP/Florianópolis-SC Drupaler for 3 yrs
  3. Disable unnecessary PHP extensions and web-server modules • PHP extensions

    consume memory heap • Some badly written can cause memory leaks • The same applies for web-server modules • Disable if you don’t need them!
  4. Fine tune your php.ini! • memory_limit memory_get_usage() / memory_get_peak_usage() •

    realpath_cache_size realpath_cache_get() • realpath_cache_ttl Max execution per thread - will affect memory usage!
  5. Does your app use session data? No: you’re good to

    go! Yes: then you’ll need to manage this data across multiple servers.
  6. Sharing session data Fault tolerant No bottleneck Cheaper buut… it

    needs architecure changes! Persistent load balancing Sharing session data PHP Session Management Persistent load balacing Single point of failure Bottleneck Expensive
  7. Avoid database specific queries. Good libraries can help (Doctrine FTW!)

    If not possible Document like any Technical Debt!
  8. How dependent of your actual environment are you? timezone paths

    connection string limits timeouts Number of tries API Keys
  9. ...