make your drupal site perform

26
15 / 03 / 2015 - Drupal Camp Cluj 2015 Make your Drupal site perform Like an athlete

Upload: ag-prime

Post on 16-Jul-2015

319 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Make your drupal site perform

15 / 03 / 2015 - Drupal Camp Cluj 2015

Make your Drupal site performLike an athlete

Page 2: Make your drupal site perform

Gabriel Ungureanu

CEO @ AG Prime, Cluj-Napoca www.ag-prime.com

Drupal developer for 7 yearshttps://www.drupal.org/u/gabrielu

Drupal module developer and Drupal 8 Sprinter

Open source enthusiastic

Page 3: Make your drupal site perform

Why performance matters?

Visitors spend less than 2 seconds to make an impression,

Google finds you relevant if the page loads in less than 2 seconds,

Download speeds differ depending on where your end-user is located,

People browse internet in the train, bus, airport, etc.,

Mobile devices (getting more and more) running mobile internet care about content size.

Page 4: Make your drupal site perform

Performance key-points

Page 5: Make your drupal site perform

Performance key-points

1. Server response time

2. Page download time

3. Page render time

Page 6: Make your drupal site perform

1. Server response time

Check your traffic expectations,

Decide your server structure, what type of data do you host?

Anonymous user

Authenticated pages

Binary data (images, video)

Page 7: Make your drupal site perform

Low traffic website

A virtual machine can do the job

Activate Drupal caching (per page, per block, per view)

De-activate Database logging (on the server as well)

Disable Devel module, UI modules

Activate CSS / JS Aggregation (see Advanced Aggregation for IE support :) )

Page 8: Make your drupal site perform
Page 9: Make your drupal site perform

Medium traffic

Memory caching (key-value pair storing)

Memcache: https://www.drupal.org/project/memcache

Redis: https://www.drupal.org/project/redisCan also persist data after restart. Useful for session storing

Heavy static content / Boost https://www.drupal.org/project/boost

Page 10: Make your drupal site perform

High traffic

A set of three

Varnish (cache server),

Application server (Drupal) - Apache or Nginx,

Database server (MySQL).

Page 11: Make your drupal site perform
Page 12: Make your drupal site perform
Page 13: Make your drupal site perform

No revision

Drupal has out-of-the-box revision control, you don’t need it in most of the cases,

https://www.drupal.org/project/field_sql_norevisions

Page 14: Make your drupal site perform

Custom distribution

Pressflow A distribution of Drupal with integrated performance, scalability, availability, and testing enhancements.

Page 15: Make your drupal site perform

Cloud hosting

Acquia Cloudhttps://www.acquia.com/products-services/acquia-cloud

Platform.sh / Developed by Commerce Guys https://platform.sh/

Pantheon https://pantheon.io/

Page 16: Make your drupal site perform

The Amazon Cloud

Elastic Cloud

RDS (Database instances)

Load balancer (pay per minute)

Spot instances (run cheap clone of your EC2 instance when your computing needs grow)

http://www.ag-prime.com/ leverages AWS to host high performing sites.

Page 17: Make your drupal site perform

2. Page download timeTime to download necessary files from the Server to the User’s device

Page 18: Make your drupal site perform

AGGREGATE CSS AND JS FILES

Make sure that:

Aggregating the content does not break your site, Make sure CSS rules are correct and don`t rely on their position in the file.

It loads correctly on all browsers (see IE Limits per Stylesheet). There is a Drupal solution for this as well, it is called Advanced Aggregation: https://www.drupal.org/project/advagg

Page 19: Make your drupal site perform

Use image spritesInclude more graphics into a single file,

Make the graphic files as small as possible,

Select them using CSS positioning.

Page 20: Make your drupal site perform

Use SVG’s and IconFonts

Smaller size, vector information represents the text format that defines it;

It's scalable, this means you can easily scale your graphics when drawing a responsive layout;

IconFonts: http://css-tricks.com/examples/IconFont/

Page 21: Make your drupal site perform

DNS & HTTP2

Make fewer DNS lookups, load the content to as FEW different domains as possible;

Aggregate content, load less files, consider using HTTP2 / SPDY;

Page 22: Make your drupal site perform

3. Page render time

Optimise the order of your content, put the important parts at the top and move the less important at the bottom (eg. move unnecessary Javascript files at the end of your document);

Use valid markup, valid markup allows the rendering engine to make less guesses;

Use as few tags as possible. You can consider starting with a light theme, like https://www.drupal.org/project/mothership

Page 23: Make your drupal site perform

Load content with Ajax

Quickly deliver pages from cache, then update content with Javascript at runtime;

Usage:

Commerce sites

News sites

Display comments, votes, etc.

Page 24: Make your drupal site perform

Authenticated users

Authenticated users constantly see different content;

Pages, Blocks, Views, Forms have different cache rules;

https://www.drupal.org/project/authcache

Page 25: Make your drupal site perform
Page 26: Make your drupal site perform

Questions?

http://fiipractic.asii.ro/cj/back-end-development