web performance & scalability tools

21
Web Scalability Web Scalability www.folio3.com @folio_3

Upload: folio3-software

Post on 14-Jul-2015

201 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Web Performance & Scalability Tools

Web ScalabilityWeb Scalability

www.folio3.com@folio_3

Page 2: Web Performance & Scalability Tools

Scalability

It is the ability of a system to handle a growing amount of

traffic/data in a capable manner

How much system can grow

How easy it is to increase capacity

Page 3: Web Performance & Scalability Tools

Generation Time

Delivery Time

Scalability

Page 4: Web Performance & Scalability Tools

Solutions Add hardware. More CPU and RAM to machine

Vertical Scalability

Costly

Higher TCO

Add another server Horizontal Scalability

More reliable

Less costly as compared to other options

Maintenance cost is higher

Page 5: Web Performance & Scalability Tools

Opportunity Areas

Database

Application

Web Server

Scripting Language

Hardware

Hosting

Page 6: Web Performance & Scalability Tools

Database

Query Optimization

Log slow queries

Check query plan to make sure indexes are used

Indexes

A lot of how-to's available

MySQL Query Cache

Performance Schema

Page 7: Web Performance & Scalability Tools

Database

Review default values

Index buffers

Innodb Buffer Pool

Number of open tables

Innodb vs MyISAM

Speed up file system

Per-table file for Innodb

Keep RDBMS updated

A lot of diagnostic tools available

Page 8: Web Performance & Scalability Tools

phpMyAdmin Advisor

Page 9: Web Performance & Scalability Tools

Database Load balancing

Route read queries to slaves

Write queries to Master

Multi-master Architecture

Offload Database server

Sphinx, Solr

Nosql (Radis, Mongo etc)

MySQL Cluster

Write intensive

Page 10: Web Performance & Scalability Tools

Application

Identify Bottleneck

Newrelic

xDebug

Framework profiling tools

Page 11: Web Performance & Scalability Tools
Page 12: Web Performance & Scalability Tools
Page 13: Web Performance & Scalability Tools

Application Use framework DB APIs

Avoid custom queries

It allows the use of plug-ins / extensions / modules

Use Framework cache APIs

Don’t by-pass framework or CMS

Profile your code

Time

Memory

Profile/Monitor third party services

Page 14: Web Performance & Scalability Tools

Application Cache output Full page cache

Can be done in: Application (Disk, memcache, apc etc) Proxy server (varnish, lightspeed)

Very effective Wikipedia serves 85% cached content. Only 15% is fetched from DB

Cache static files in memory Query Results Cache

Reduces number of queries Reduce IO

Avoid file_exists sort of checks Reduce file operations

Page 15: Web Performance & Scalability Tools

Web Server Explore options

Apache Nginx Litespeed

Load balancing HAProxy Ldirector Varnish (define multiple backend) Nginx, Apache balancer modules

Decide balancing strategy Round robin, Last used, Weighted

Do heavy lifting in crons, message queues

Page 16: Web Performance & Scalability Tools
Page 17: Web Performance & Scalability Tools

Web Server

Fine-tune web server

Don’t rely on default configurations

Make web server use multiple cores

E.g worker_processes for nginx

Check your specific server configuration

KeepAlive sort of options

A lot can be done

Page 18: Web Performance & Scalability Tools

Scripting Language (php) Enable opcache

APC

Opcache in 5.5

eAccelerator

Fine-tune settings

Real path cache

Buffers

Max memory per script

Look for best practices for that language

Page 19: Web Performance & Scalability Tools

Hardware Disk is the slowest part of the system

Go for SSD

Reduce IO

Offload Extensive downloads

Cloud files

CDN

File system optimizations

Number of files in folder

RAID

Page 20: Web Performance & Scalability Tools

Hosting Cloud vs. Dedicated

Cloud makes scaling easy

Easy to add hardware

Easy to build

Cloud is cheaper as compared to dedicated hardware

Easy to separate DB & Application server

Avoid having control panels on servers

Cloud has slight performance disadvantage

Does not work well when it is raining.

Page 21: Web Performance & Scalability Tools

Resources

http://www.slideshare.net/mkherlakian/high-performance-php-scaling-and-

getting-the-most-out-of-your-infrastructure

http://www.slideshare.net/mohamed_almasry_lamp/lamp-applications-

scalability-lamp-web-applications

http://20bits.com/article/10-tips-for-optimizing-mysql-queries-that-dont-

suck