Server optimization

Sang Le Thanh

Drupal Senior Developer

  • GO1VN
  • 7 years with Drupal https://www.drupal.org/u/shellingfox
  • 4 years with system admin
  • me[at]sanglt[dot]com

What's perfomance and scale?

Perfomance is the speed at which a computer operates in a time. At our company, it is complete a PHP request

Also, scale have same meaning. And i define it as:

Perfomance: Tweak the system to handle most request without upgrade hardware.

Scale: Update hardware to handle more request. 

Improve perfomance

Make a PHP request complete fastest, that's mean we can handle more request in same time.

Web Performance Best Practices

We can do it very simple, just install google mod_pagespeed (support apache and nginx)

performane increase 2~3x

Opcode Cache

PHP is interpreted => When we have a request => PHP is combile a code => run it => return.

Solution: Make PHP is compiled

 

First time have request => PHP combiled source and store to cache, every request later PHP will using binary code from cache.

Reduce PHP combile time 30~60%

LAMP vs LEMP

  • Linux: Apache + MySQL + PHP
  • Linux: Nginx + MySQL + PHP

Nginx handle static file faster than Apache.

PHP running via FPM

MySQL: Using MariaDB or Pecona

Backend optimization

Ex: An Inner join query without condition make Pantheon server die

I'll have a topic about this in next time.

Question and Answer

sang@go1.com.au

Server optimization

By Sang Lê Thanh

Server optimization

  • 784