0% found this document useful (0 votes)
106 views22 pages

Scalability in Dynamic Websites

This document discusses techniques for scaling websites, including using web hosts, virtual private servers (VPS), vertical scaling by improving individual server specs, horizontal scaling by adding more servers, PHP acceleration through opcode caching and accelerators, load balancing across servers using software or hardware load balancers, caching HTML, database queries, and content using memcached, MySQL query caching, database replication for performance and high availability, and partitioning data across multiple database servers. It provides examples of specific software and services for each technique.

Uploaded by

samyakmehta1234
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views22 pages

Scalability in Dynamic Websites

This document discusses techniques for scaling websites, including using web hosts, virtual private servers (VPS), vertical scaling by improving individual server specs, horizontal scaling by adding more servers, PHP acceleration through opcode caching and accelerators, load balancing across servers using software or hardware load balancers, caching HTML, database queries, and content using memcached, MySQL query caching, database replication for performance and high availability, and partitioning data across multiple database servers. It provides examples of specific software and services for each technique.

Uploaded by

samyakmehta1234
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Science S-75

Building Dynamic Websites


Harvard Extension School
[Link]

Lecture 9: Scalability
David J. Malan malan@[Link]
0

Web Hosts

Bluehost DreamHost Go Daddy Host Gator pair Networks

VPSes

DreamHost Go Daddy Host Gator Linode pair Networks Slicehost VPSLAND


2

Vertical Scaling

CPU

cores, L2 Cache, ...

Disk
PATA, SATA, SAS, ... RAID

RAM ...

Horizontal Scaling

Image from [Link].

PHP Acceleration

Code Optimization Opcode Caching ...

PHP Accelerators

Alternative PHP Cache (APC) [Link] eAccelerator [Link] XCache [Link] Zend Platform [Link] ...

Load Balancing

[Link]

Load Balancing with BIND


www www www www IN IN IN IN A A A A [Link] [Link] [Link] [Link]

Sticky Sessions

Shared Storage?
FC, iSCSI, MySQL, NFS, etc.

Cookies?

Load Balancers

Software
ELB HAProxy LVS ...

Hardware
Barracuda Cisco Citrix F5 ...

10

Caching

.html MySQL Query Cache memcached ...

11

.html

12

MySQL Query Cache


query_cache_type = 1

[Link]

13

memcached
$memcache = memcache_connect(HOST, PORT); $user = memcache_get($memcache, $id); if (is_null($user)) { $dbh = new PDO(DSN, USER, PASS); $result = $dbh->query("SELECT * FROM users WHERE id=$id"); $user = $result->fetch(PDO:FETCH_ASSOC); memcache_set($memcache, $user['id'], $user); }

[Link] [Link]

14

MySQL

[Link]

15

Replication: Master-Slave

Excerpted from High Performance MySQL.

16

Replication: Master-Master

Excerpted from High Performance MySQL.

17

Load Balancing + Replication

Excerpted from High Performance MySQL.

18

... + Partitioning

Excerpted from High Performance MySQL.

19

High Availability

Excerpted from High Performance MySQL.

20

Computer Science S-75


Building Dynamic Websites
Harvard Extension School
[Link]

Lecture 9: Scalability
David J. Malan malan@[Link]
21

You might also like