Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend

260 views

Published on

Coming back to our discussion on fast internet, we have so far covered how to optimize a developer’s journey and enhancing frontend website delivery.

In our next session, we shall look into a very core part of the Drupal ecosystem - the Drupal backend. These are the components that create, update and get the content that you show to your end users. It controls user permissions, what content to show on which page, and uses modules like views to get more content to show as a list or a slideshow. It powers the search features, menu system, every page structure and more. The more work you give it, heavier is the load on it. And that makes it slow.

So why don’t we help our Drupal backend system, to ease the load, speed up what it is looking for, cache a few frequent tasks its performs and give it a nice booster! Why? If the backend system fails, it will timeout and not render any output for the requests that come in. Each request will be put in a long and slow queue to get a response. Only when we get an initial response to the browser or an API call, can the rest of the page rendering begin.

To learn how to alleviate these problems, join our tech talk to learn about:

Drupal Architecture - module selection, content structure, page structure
Content displays
Content reuse
Views, Blocks, Panels
Caching data - memcache
Caching code - APC
MySQL tuning - Check Slow queries
XHProf - Check any heavy PHP code
Contrib v/s Custom
Dynamic page cache
Disable non-Prod modules
Database Logs - switch it to syslog
Acquia Insight Tool
API first & Decoupled Drupal

Published in: Technology
  • Be the first to comment

Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend

  1. 1. Pavithra Raman - Team Lead, Solution Architect Enhancing Back End Drupal Development & Performance Drupal 8 Lessons From the Field
  2. 2. Agenda Recap: Importance of Speed & Performance Common Causes & Effects Best practices & Checkpoints
  3. 3. Recap: Importance of Speed & Performance END USER EXPERIENCE Expect fast page loads / reloads Faster interactions Channels no longer restricted to websites Decoupled and mobile applications Integration with 3rd party for richer and personalized journey
  4. 4. Impacts END USER EXPERIENCE More wait time - customers move on Lesser or irrelevant information - seek another source Website only - leads only via SEO/ADs SEO - affected Multi-channel experience affected - mobile/tablet based audience left behind
  5. 5. But why is it happening ?
  6. 6. Fight the good fight, but compromise Designer/Marketer Developer ? ● Customer experience ● Larger Media assets ● More features ● Goal: Visually attractive and engaging experience ● Server side performance ● Content generation ● Reduce response time ● Goal: Cacheable and scalable content/asset creation & delivery
  7. 7. Drupal - very powerful Content Management / Digital Experience System Lot of features Content Taxonomy Media Templating engine User management API First Panelizers Workflow e-commerce and many many more …. With great power comes great responsibility
  8. 8. Common Causes Biggest/Obvious causes - Drupal Architecture - Site planning - Business logic via customizations - Caching missing - Drupal configuration - Server Architecture
  9. 9. Common Causes Smaller/Hidden causes ( we might miss these ) - MySQL slow queries - Information architecture - 3rd Party integrations - Content Display / Theme ( What ? ) - Slow Complex code (CPU/RAM spikes)
  10. 10. Effects - Number requests dropped - Slow Drupal requests - PHP max timeout - Server CPU/RAM maxing out - MySQL server overload - Impacts on the front end delivery - Easy target for DDoS attacks - Unusable content editorial
  11. 11. Oh… I will just solve it using decoupled Node.js Server side rendering is faster you know
  12. 12. Uhhh.. Well…. ❏ Yes, but not completely. ❏ Content creation is still happening via the Drupal UI for many of these applications. ❏ Any custom logic or 3rd party integrations to connect other sources might be invoked via the Drupal layer ❏ You still need fast performing APIs
  13. 13. 13 ©2016 Acquia Inc. — Confidential and Proprietary Best practices & Checkpoints Understand end user experience Business requirements Custom Logic 3rd party integration Editorial add-ons Ideal experience benchmarks Information architecture Module selection Library selection Function reuse Content reuse Drupal setup Customizations as per Drupal Coding standards Caching Performance test / PHP profiling with development Front End + Theming Drupal Request profiling MySQL slow query log Load Testing Acquia Insight Requirements Architecture Implementation Testing / QA
  14. 14. Does the experience require any complex front end components like display effects, asynchronous content refresh, rich media experience, etc. Does the application need any complex data processing, presentation logic, dynamic components ? Does the 3rd party integration provide you with hi-speed APIs? Does this 3rd party add more load to your code? Does your application have to do more processing on the Drupal layer? Requirements Review Samples For the content editorial experience, do we need any add-ons for image processing, WYSIWYG editors, in-line editors, heavy media/assets uploaded, complex and heavy data structures for content? From the perspective of various users, content consumers, content editors, media managers, decoupled applications connecting to the Drupal backend what are the response benchmarks?
  15. 15. - Maintain Drupal core and contributed modules at latest stable version - Custom modules as per Drupal Code-standards - Drupal API + Hooks - PHP, OOPS, Symphony - JS - CSS - Select modules as per current and future requirements Architecture Best Practices
  16. 16. - Client side caching - Varnish cache - Drupal Internal Dynamic Page cache - Drupal Internal Page cache - Page cache max time ( dependent on content update frequency ) - Memcache - APC - opcode cache - Uninstall unused modules Implementation Best Practices - Optimized Images/Media - Responsive images/pages via different images - Aggregation and compression of JS/CSS - Bigpipe - Lazy Loading - Clean twig templates
  17. 17. Tools: Unit testing - Dev - XDebug + XHProf - PHP profiler - Devel module - Automated tests: Behat, Drupal - Google Pagespeed Insights - Acquia Insight What to test for ( against ideal benchmarks ) - Resource utilization ( CPU, RAM, PHP procs, cache) - Cache hit ratio - MySQL utilization / Slow queries - OutOfMemory = OOM errors - Response time Testing & Tuning Pre-Production: Before Go Live Test on Production-like setup - Resource utilization - Cache hit ratio - Database performance - Load Tests - Acquia Insight
  18. 18. GO LIVE !! Server deployment Drupal Optimized Server setup Caching Logs Production Optimized Drupal Configuration
  19. 19. - Front end asset / page cache using - Varnish/CDN - Load Balancing for easy scaling - Web server optimized for Drupal - PHP with - APCu for PHP code cache - memcache ext + - Dedicated or co-hosted memcached for Drupal cache tables - MySQL optimized for Drupal - Read/Write optimized storage - Dedication Cron server if required Production - Checklist - Disable Database Logging - Enable syslog ( to send logs to server logging system ) - Disable non-production required modules - ex. modules enabled for testing - Views UI, Config UI - Page cache settings - Page + Blocks + Views + Others - API cache & security setup - Aggregate & compress - JS + CSS
  20. 20. Questions
  21. 21. Thank You
  22. 22. 200-500ms “Good” TTFB (Time To First Byte) https://www.rackaid.com/blog/time-to-first-byte/
  23. 23. 1s to 3s “Good” TTLB (Time To Last Byte) https://yoast.com/page-speed-ranking-factor/
  24. 24. Page weight http://www.httparchive.org/interesting.php (October 16th)
  25. 25. Page weight http://www.httparchive.org/interesting.php (October 16th) Average LTE speed is 5- 12Mbps This page would take 2-5 seconds to download!
  26. 26. Images http://www.httparchive.org/interesting.php (October 16th) 54%

×