Changes

Jump to: navigation, search

Webtools:Scalability

2,950 bytes added, 17:54, 12 April 2007
no edit summary
{{draft}}
=Scalability and Performance=
This document is a short summary of our infrastructure and software for developing high performance web apps. When a new project is being considered/written, it should be planned with the following in mind, so it can scale well.

==Infrastructure==
===[http://www.citrix.com/English/ps2/products/product.asp?contentID=21679 Netscaler]===
''[http://people.mozilla.org/~mrz/ns/7.0/ Manuals and Release Notes]''

One of the best ways to lower the load on a server is to reduce its traffic, which is essentially the goal of the netscaler. The netscaler sits between the webservers and provides:

* SSL offloading: SSL connections are made with the netscaler (which has hardware dedicated to setting up SSL connections) instead of the webservers. Connections to the webservers are always over http (if you're writing code that is expecting https, realize that the webheads never see the ssl connection)

* Content Caching: Outbound content (webhead -> internet) is cached according to rules on the netscaler. To get the current set of rules, you'll need to talk to IT. The default set of rules is on page 336 of the [http://people.mozilla.org/~mrz/ns/7.0/NS_ICG_V2.pdf 2nd install guide]

* Some monitoring/balencing of the web servers. Webservers that respond faster are given more traffic. If a webserver becomes unresponsive, the netscaler will discontinue sending requests to it until it comes back to life.

=== Production Webserver Cluster ===

Behind the Netscaler is a cluster of 12 webservers (+/- a few at any given time). Most sites are on one or more webservers. When developing code, realize that requests can go to any of the webservers at any time, so it's important to make your code independant of the specific server (use the db for sessions, etc.)

* [https://nagios.mozilla.org/graphs/mpt/Systems/webapp_81.html Load graphs] (ldap login) for the webheads are available


=== Database Servers ===

There are 4 (+/- a couple) database servers running MySQL.

* A read-only slave is available, and is generally only a couple seconds (<10) behind the master.

* [https://nagios.mozilla.org/graphs/mpt/Systems/ Load graphs] (ldap login) for the db servers are available

=== Staging Servers ===

These are ...

=== Development Servers ===

Currently, development is done on standalone virtual machines running all the software (mysql, apache, etc.). Generally, development servers are only available in the VPN.




== Coding ==

Reasonably efficient code should always be a first step when considering performance issues (don't put queries in loops, etc.). Due to the large amount of traffic we get, we need to supplement our code with additional caching software.


=== [http://pecl.php.net/package/APC APC] ===

=== [http://eaccelerator.net/ eAccelerator] ===


=== [http://pecl.php.net/package/memcache/ Memcache] ===

* [http://en.wikipedia.org/wiki/Memcached Additional Memcache Info]
Confirm, emeritus
1,737
edits

Navigation menu