29.11.2012 Views

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

�����������<br />

�����������<br />

�����������<br />

����������<br />

�����������<br />

����������<br />

�����������<br />

����������<br />

�<br />

����������<br />

�����������������<br />

��������������������������<br />

��������<br />

������������<br />

�����������<br />

�����������������<br />

Figure 8: Cluster architecture. Notificati<strong>on</strong>s must go<br />

through notificati<strong>on</strong> servers where they are relayed to<br />

servers with matching interests.<br />

likely to be similar to the <strong>on</strong>es above where<br />

they either (a) observe <strong>on</strong>e or more individual<br />

values (or rows) like get new instances and<br />

get modified instance, (b) observe a sequence<br />

of messages or changes like receive messages and<br />

get new instances, or (c) make more complex observati<strong>on</strong>s<br />

like get attribute changes, in which<br />

case they will create an auxiliary data structure in the<br />

form of a sequence.<br />

5 Cluster Support and Scalability<br />

Large-scale <strong>Web</strong> applicati<strong>on</strong>s must use clusters of applicati<strong>on</strong><br />

servers to handle the required load; the cluster size<br />

can vary from a few servers to thousands. Typically, any<br />

applicati<strong>on</strong> server is capable of handling any client request<br />

(though the networking infrastructure is often c<strong>on</strong>figured<br />

to deliver requests for a particular browser to the<br />

same server whenever possible); the data for the applicati<strong>on</strong><br />

is kept in storage that is shared am<strong>on</strong>g all of the<br />

servers, such as a database server.<br />

Introducing l<strong>on</strong>g polling to a cluster envir<strong>on</strong>ment complicates<br />

the notificati<strong>on</strong> mechanism because events originating<br />

<strong>on</strong> <strong>on</strong>e server may need to propagate to other applicati<strong>on</strong><br />

servers. Many events will be of interest to <strong>on</strong>ly<br />

a single server (or may have no interests at all), while<br />

other events may be of interest to nearly every server.<br />

One possible soluti<strong>on</strong> would be to broadcast all notificati<strong>on</strong>s<br />

to all applicati<strong>on</strong> servers. This approach behaves<br />

correctly but does not scale well since every applicati<strong>on</strong><br />

server must process every notificati<strong>on</strong>: the notificati<strong>on</strong><br />

workload of each server will increase as the total number<br />

of servers increases and the system will eventually reach<br />

a point where the servers are spending all of their time<br />

handling irrelevant notificati<strong>on</strong>s.<br />

For Vault we implemented a more scalable soluti<strong>on</strong><br />

9<br />

using a separate notificati<strong>on</strong> server (see Figure 8). When<br />

an interest is created <strong>on</strong> a particular applicati<strong>on</strong> server,<br />

that informati<strong>on</strong> gets forwarded to the notificati<strong>on</strong> server<br />

so that it knows which applicati<strong>on</strong> servers care about<br />

which interests. When an interest is notified <strong>on</strong> a particular<br />

applicati<strong>on</strong> server, the notificati<strong>on</strong> is forwarded to<br />

the notificati<strong>on</strong> server, which in turn notifies any other<br />

applicati<strong>on</strong> servers that care about the interest. With this<br />

approach <strong>on</strong>ly the applicati<strong>on</strong> servers that care about a<br />

particular interest are involved when that interest is notified.<br />

The notificati<strong>on</strong> server is it similar to the local<br />

notifier, but it works with interested servers, not interested<br />

requests. In particular, both have the same basic<br />

API (create interest, remove interest, and notify).<br />

For large <strong>Web</strong> applicati<strong>on</strong>s it may not be possible for<br />

a single notificati<strong>on</strong> server to handle all of the notificati<strong>on</strong><br />

traffic. In this case multiple notificati<strong>on</strong> servers can<br />

be used, with each notificati<strong>on</strong> server handling a subset<br />

of all the interests. Local notifiers can use a c<strong>on</strong>sistent<br />

hash functi<strong>on</strong> [15] <strong>on</strong> each interest to determine which<br />

notificati<strong>on</strong> server to send it to.<br />

One of the advantages of the API we have chosen for<br />

notificati<strong>on</strong> is that it distributes naturally as described<br />

above. Furthermore, the decisi<strong>on</strong> to allow extraneous<br />

notificati<strong>on</strong>s simplifies crash recovery and several other<br />

management issues for notificati<strong>on</strong> servers.<br />

Crash recovery is simple in Vault due to these properties.<br />

If a notificati<strong>on</strong> server crashes, a new notificati<strong>on</strong><br />

server can be started as its replacement. Each of the applicati<strong>on</strong><br />

servers can deal with the crash by first recreating<br />

all of its local interests <strong>on</strong> the new server and then<br />

notifying all of those interests locally (just in case a notificati<strong>on</strong><br />

occurred while the original server was down).<br />

Most of the notificati<strong>on</strong>s will be extraneous but the feeds<br />

will detect that nothing has actually changed. This behavior<br />

is correct but may be slow depending <strong>on</strong> the number<br />

of interests.<br />

There is an additi<strong>on</strong>al crash recovery issue in Vault,<br />

which occurs if a feed crashes after updating its data but<br />

before notifying the notificati<strong>on</strong> server. In Figure 6, this<br />

could happen if the server crashes <strong>on</strong> line 22. If an applicati<strong>on</strong><br />

server crashes, there is no way to tell whether it<br />

was about to send notificati<strong>on</strong>s. To avoid losing notificati<strong>on</strong>s,<br />

every existing interest must be notified whenever<br />

any applicati<strong>on</strong> server crashes. Another alternative is to<br />

use a two-phase notificati<strong>on</strong>, but the associated overheard<br />

makes the first alternative a more attractive opti<strong>on</strong>.<br />

6 Benchmarks<br />

We ran a series of experiments to measure the performance<br />

and scalability of the Vault notificati<strong>on</strong> mechanism.<br />

Our intent was to determine how many servers are<br />

needed to handle a given load. We ran our experiments<br />

<str<strong>on</strong>g>USENIX</str<strong>on</strong>g> Associati<strong>on</strong> <strong>Web</strong>Apps ’11: <str<strong>on</strong>g>2nd</str<strong>on</strong>g> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> <str<strong>on</strong>g>C<strong>on</strong>ference</str<strong>on</strong>g> <strong>on</strong> <strong>Web</strong> Applicati<strong>on</strong> <strong>Development</strong> 121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!