Docsity

Load Balancing - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Partial preview of the text

Download Load Balancing - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Load Balancing

-^

Web servers enable scale out, so you can just add more server boxes to handle more load.

-^

To simplify this problem^ –

Ensure all web servers are identical (no server-specific state)^ ⇒

don’t retain client state on web servers (hard to avoid …)

Randomly assign requests to servers (e.g., use an IP sprayer)

Avoid sending requests to a failed server

11.4 Transaction Bracketing

-^

For the most part, Workflow Controllers (WFC) andTransaction Servers are just plain old server programs

-^

The main WFC differentiating features^ –

Brackets transactions (issues Start, Commit, and Abort)

Handles Aborts (returns cause of the Abort)

Does not access the DBMS

Transparent Transaction Bracketing

-^

Transaction-hood is a property of the app component.

-^

In COM+, a class is declared:^ –

requires new

  • callee always starts a new transaction

required

  • if caller is in a transaction, then run callee in

caller’s transaction, else start a new transaction

supported

  • if caller is in a transaction, then run callee in

caller’s transaction, else run outside of any transaction

not supported

  • don’t run in a transaction -^

Caller can create a transaction context, whichsupports Commit and Abort (chained model).^ –

Callee issues SetComplete when it’s done and willing tocommit, or SetAbort to abort.

Transparent Txn Bracketing (cont’d)

-^

EJB and J2EE^ –

Implements COM+ technology in Java: RequiresNew, Required,Supported, NotSupported

It came later, so there are two additions.

Mandatory – If caller is in a transaction, then run the callee inthat transaction, else raise an exception

Never – If caller is in a transaction, then raise an exception

Savepoints

-^

Savepoint - a point in a program where an applicationsaves all its recoverable state

-^

Can restore a savepoint within the transaction that issued the savepoint. (It’s a partial rollback.)

-^

SQL DBMSs use them to support atomic SQL statements.

Start;get-request;Savepoint(“B”);.

if

(error) {Restore(“B”);

Commit;}

Commit;

-^

Savepoints are not recoverable. If the system fails or thetransaction aborts, the txn is completely undone.

11.5 Processes and Threads

-^

Application Server architecture is greatly affected by^ –

which components share an address space

how many control threads per address space

-^

TP grew up in the days of batch processing, and reachedmaturity in the days of timesharing.

-^

TP users learned early that a process-per-user fails:^ –

Too much context switching

Too much fixed memory overhead per process

Process per user per machine, when distributed

Some OS functions scan the list of processes

Load control is hard

Mapping Servers to Processes

-^

Presentation/Web servers, workflow controllers, andtransaction servers are multithreaded servers

-^

Costs 1500 - 25,000 instructions per process call, vs.50 instructions per local procedure call …^ –

but it scales, with flexible configuration and control