Caching for Cash - Part 1

Embed Size (px)

Citation preview

Caching For Cash

php|tek Chicago, May 2009

Who is Helgi ?Head of R&D at echolibre, pear extraordinaire,published author, party person and an Icelander

Who is Scott ?Works at Jelsoft, php core developer, published author, party person and a Scottish person

What do you use ?

Identify the performance issues

Analyze the issue

Fix the issue

What we want to accomplish today is ...

3 Easy Steps to Remember

Locate

Diagnose

Recitfy

Location is EverythingWebsites have more pages than you think.Performance effects are aggregate.

Mild performance on frequently accessed pages

Bad performance on infrequently accessed pages

Poisoned shared resources Database Buffer CacheNetworketc

Diagnostics Finding the bottlenecks

Script ProfilersAPDXDebug

Benchmarking Tools

abSiegeApache FloodMemtrackXHProf

GUIMarkHardinfoBonnie++

Right mixture of tools for the product

Strained External ResourcesOverloaded databases

Badly configured machines

NFS / File system contention

Solutions:

Get a real system administrator

Pick the right database for the job

Clustered / Proxy databases

Faulty Database RequestsMissing indexes.

Poor schema architecture.

Bad database tuning.

Selecting too many columns / rows

3rd Party Network RequestsProxy callout to external services

Remote PHP includes

REST / AJAX

SOAP / RPC calls

Solutions:

Cache the network calls

Design your AJAX so you can easily cache it

Expensive ProcessingImage manipulation

Encryption

system/exec/etc. function calls

Solutions

Off load work to other machinesGearman and similar are your friends

Bad Algorithm DesignPerforming extensive looping text replacements

Performing extensive looping in general

Badly written Regular Expressions

Extensive recursive functionality

Go forth and make it faster! Questions ?

Click to edit the title text format