Professional Documents
Culture Documents
Peer-to-Peer Caching Schemes To Address Flash Crowds
Peer-to-Peer Caching Schemes To Address Flash Crowds
Although functionally similar, the two rewrite tech- neighborhood of an overlay node, but all such popular
niques have different performance implications. The systems can be easily modified to export this informa-
DNS-based rewrite can overlap the document location tion through their APIs.
task, triggered by an intercepted DNS request at the
surrogate node, with the HTTP/TCP client connection
establishment that follows. On the other hand, DNS
3.3 Caching and Replication
requests can result in long latencies in high-loss envi- Although using a distributed hash table, such as a CAN,
ronments because of UDP time-outs, especially for wire- explains how we find a copy of a popular document
less clients. As a result, embedded links served to client within the Backslash web mirror, it does not explain how
browsers coming from “nearby” network locations use the copy was created or propagated through the system.
DNS rewriting, whereas HTTP rewriting is used for more In this section we explain the basic cache diffusion tech-
remote clients, based on local policy. niques we explore in the context of Backslash.
When URL rewriting is not an option, specifically in Each Backslash node has some available storage for
the case of the first request to an overloaded node from use in caching (a few times the size of its local docu-
a particular client, plain redirection is used, again ei- ment collection). This storage is split in two categories:
ther via DNS or HTTP. For example, the mini DNS replica space and temporary cache space. On one hand,
server responsible for the backslash.stanford.edu do- a replica is a cached copy of a document that is guar-
main (which is a Backslash node itself) can return the anteed to be where it was placed. Replicas are placed
IP address of a surrogate node when asked for the A in the overlay by insertion operations of the distributed
record of www, when the Stanford site is in overload mode. hash table. A temporary cache, on the other hand, is
Similarly, HTTP redirection uses REDIRECT responses to a cached copy of a document that is placed opportunis-
cause browsers to retry a request at a rewritten URL. tically at a node of the overlay to speed up subsequent
The combination of URL rewriting and redirection al- retrievals. Temporary caches are created in response to
lows unaware client browsers to reach an unloaded sur- retrieval operations of the distributed hash table and are
rogate Backslash node that will serve their requests. We not guaranteed to remain where they are placed. In fact,
explain how surrogate Backslash nodes serve requests for they might be replaced very soon after they are created if
content from other sites’ collections in the next section. they are the least recently used temporarily cached docu-
ment of a node. A fixed portion of the available free space
3.2 Resource Location of each node is allocated as replica space. Whatever re-
mains unused in the replica space and the remainder of
Once a surrogate Backslash node has received a request the free space is allocated as temporary cache space.
for a document of the afflicted site, it has to act as a The Backslash replica space is used exclusively for the
gateway between the HTTP client browser and the col- first copy of each file in the participating mirrored web
laborative mirroring portion of Backslash. collections. Every Backslash node periodically injects
Mirroring is implemented on a peer-to-peer overlay fol- the documents in its local document collection into the
lowing the distributed hash table paradigm. Systems in distributed hash table. The single copy of each such doc-
this category [3, 4, 5, 6] implement a hash table over a ument created at insertion time is a replica. In the cache
large number of self-organized nodes. Each node is re- diffusion schemes we explore in the remainder of this pa-
sponsible for a chunk of the entire hash table. If the hash per we create no other replicas.
function used by the table is uniform, then regardless of The first cache diffusion method we consider is local
the distribution of resource names stored, resources are diffusion. In local diffusion, each node serving a docu-
distributed uniformly over the hash space. As long as the ment as a replica or temporary cache monitors the rate
chunks of the hash space assigned to participating nodes of requests it receives for that document. When the node
are of roughly equal size, then each node maintains a determines that the request rate has reached a predeter-
roughly equal portion of all resources stored into the dis- mined push threshold, it pushes out a new temporary
tributed hash table, thereby achieving load balancing. cache of the document one overlay hop closer to the
Backslash is specifically implemented on the Con- source of the last request. This technique aims to of-
tent Addressable Network [4], but does not rely on the fload some of the demand by having more nodes in the
specifics of CAN for its operation. The overlay used un- locality of an observed flood intercept and serve requests.
derneath Backslash is mostly interchangeable with any In a sense, a node that observes a local flood creates a
other distributed hash table. In addition to hash ta- “bubble” of temporary caches around itself, diffusing its
ble operations, Backslash requires knowledge about the load over its neighborhood. The diameter of the bub-
4
ble grows in relation to the intensity of the flood, until free space, of which exactly half is allocated to replicas,
no node on the perimeter of the bubble observes high and the other half to temporary caches. For simplicity,
request rates for the document. the document collection owned by each node consists of
The second cache diffusion method we consider is di- a single document and all documents have exactly the
rectory diffusion. In this method, the distributed hash same size. We present a brief preliminary exploration of
table stores directories of pointers to document copies two particular design choices in our cache diffusion mech-
instead of the document copies themselves. Replicas and anism: diffusion agility and probabilistic forwarding.
temporary caches are also stored in Backslash nodes, but Diffusion agility is the speed with which Backslash re-
their location is not related to the hash table structure. acts to a new flash crowd. A highly agile diffusion mech-
When a node receives a newly inserted document, it cre- anism spreads out cached copies of the flooded document
ates a directory for it, picks a random Backslash node rapidly, so as to reach a state where the downpour of re-
and stores a replica for the document at that node, doc- quests for that document can be served collectively by
umenting it in its own directory. When the directory re- as many nodes as possible. However, high agility also
ceives a request for the document, it returns as many per- carries an early commitment of heavy resources (storage
muted directory entries pointing to individual copies of space, cache diffusion bandwidth) to a flood that might
the document as it can fit in a single response packet. To not necessitate them. By controlling agility, we allow the
create new temporary caches, the directory node moni- system to moderate the amount of resources it commits
tors the request rate for the document. When the request to a particular flood.
rate reaches a predetermined threshold, the directory re- We represent this agility parameter by a push thresh-
sponds to the requester with an invitation to become a old, the number of requests a node must serve before it
new temporary cache along with the list of pointers to decides to push to its neighbors a copy of the flooded file.
copies of the file. A push threshold of one means that every time a Back-
Both cache diffusion techniques require that a node slash node receives a request, it also pushes out a copy of
serve a request if it holds a copy of the requested doc- the requested file to the neighbor that forwarded it the
ument. We explore a modification of this requirement request for caching. A push threshold of 100 means that
whereby a node may choose (at random) to forward a the node only pushes out a new cache of a requested file
request even if it already holds a copy of the requested after every 100-th request.
document. This allows the node to shed probabilistically To illustrate the effects of the push threshold, we have
a fraction of the request load it observes, without creat- simulated a scenario where two floods are handled at the
ing new temporary caches. We introduce this variation, same time by Backslash. The first flood starts alone and
called probabilistic forwarding, to increase the reuse of manages to saturate the system by causing a copy of the
already existing caches and curtail the creation of new first flooded file to be placed at every node. After satura-
ones. This is especially the case for the local diffusion tion, and while the first flood is ongoing, the second flood
method, where all requests originating outside the “bub- begins, gradually displacing cached copies of the first file
ble” are handled by the nodes at the perimeter, leaving for copies of the second file. Finally, the second flood
caches inside the bubble practically unused. Probabilis- terminates, allowing the first file to saturate the system
tic forwarding enables the use of caches in the interior. again. Figure 1(a) shows how the diffusion evolves in this
scenario for a push threshold of one. Note how agility is
very high; the system responds very rapidly to changes
4 Evaluation in offered load.
The benefits of using lower push thresholds are illus-
In our preliminary evaluation efforts, we have focused on trated in Figure 1(d). The figure graphs the cumulative
the behavior of cache diffusion techniques. The mecha- load distribution over the system for the short second
nisms responsible for interjecting Backslash into the pro- flood for three representative thresholds: 1, 22 and 43.
tocol stream of unaware client browsers (delineated in On one hand, with a threshold of one, the second flood
Section 3.1) or for building simple self-maintained over- causes no higher a load than 300 requests to any node.
lays (pointed to in Section 3.2) are available and pose On the other hand, with the highest threshold of 43 only
no significant challenges for the purposes of our target 600 nodes participate in caching the second file at any
application. one time and the maximum per node load reaches almost
Our experimental setup involves 1,000 nodes partici- 800 requests.
pating in a single two-dimensional CAN overlay. Each However, higher agility makes the satisfaction of re-
node has twice the size of its own collection in available quests for the second file more expensive. For the same
5
(a) Diffusion for (b) Cache pushes vs. (c) Request load of (d) Request load of
threshold 1 push threshold first file second file
# of cache pushes
20000
Group size
Group size
Request #
15000
0
0
100000
200000
300000
10
20
30
40
200
400
600
200
400
600
# of caches Push threshold Max load Max load
Figure 1: The simultaneous flash crowd scenario discussed in the text. (a) Cache diffusion during the evolution of the
scenario. (b) Number of cache pushes as a function of the push threshold. (c) and (d) Cumulative load distribution of
requests served as a function of the number of requests served per node for the first, long flood and the second, short flood,
respectively.
number of requests satisfied, higher thresholds result in bilistic forwarding during a single flood. We have cal-
much fewer cache pushes in the face of contention. Fig- ibrated the push threshold of the probabilistic run so
ure 1(b) graphs the total number of cache pushes as a as to achieve similar diffusion patterns between the two
function of the push threshold. Threshold one results in runs (see Figure 2(a)). Surprisingly, although we initially
almost 25,000 cache pushes, of which 23,000 are mainly expected probabilistic forwarding to even out the distri-
due to the oscillations caused by contention between the bution of load among nodes with caches of the flooded
first and second files. The hysteresis introduced by the file, the graph shows only a very small improvement;
highest threshold of 43 mitigates this effect, as indicated specifically, there are slightly more lower-load nodes and
by the almost tenfold reduction in cache pushes shown in slightly fewer higher-load nodes. We ascribe this surpris-
the graph. Note, however, that the actual point where ing result to the monolithic fashion in which we measure
the benefit of lower threshold justifies the cost is spe- load in our simulations. We conjecture that although
cific to the underlying topology and resource restrictions the cumulative load per node in the duration of the ex-
of each Backslash participant, for whom a temporarily periment seems only a little affected by the use of prob-
high load might be justified by overall lower traffic. abilistic forwarding, it is the distribution of that load
As described in Section 3.3, in local diffusion cached over time within a single node that improves, that is,
copies of a flooded document inside a cache “bubble” are becomes less bursty, in this case. Deterministic forward-
only used by requests initiated locally, whereas caches ing creates high bursts of load at the perimeter of the
on the perimeter of the bubble are used locally and bubble since all nodes must service their requests. Upon
also by requests initiated outside the bubble. This reaching its threshold, the bubble expands outward and
makes perimeter caches much hotter than internal bub- a new perimeter services incoming requests. Once a node
ble caches. We explore the use of probabilistic forwarding is no longer at the perimeter of the bubble, it does not
as a method to spread out the load of the perimeter in- receive requests from outside and its load drops signifi-
curred by requests initiated outside the bubble over all cantly. Probabilistic forwarding allows interior nodes to
the nodes within the bubble. continue servicing requests even after they are no longer
We use a probability function that assigns a linearly at the perimeter of the bubble.
decreasing forwarding probability to every bubble node The results are similar when two floods of equal inten-
on the path from an external request originator to the sity compete against each other. Figure 2(d) shows the
authority node. In this way, a cache at the perimeter of difference in load distribution with and without proba-
the bubble has a maximum forwarding probability (60% bilistic forwarding for one of the two simultaneous floods.
in our experiments). Subsequent next hop nodes toward While probabilistic forwarding evens out the load distri-
the center of the bubble decrease their forwarding proba- bution in favor of lower loads, the effect is not quite as
bility proportionally as they get closer to the center. We significant as we had anticipated. We hope to experi-
would expect to see a better load distribution among the ment with different forwarding probability functions to
nodes of a bubble as a result of this technique. achieve a more pronounced benefit.
In Figure 2(b) we show the effects of using proba- This is a very preliminary evaluation of cache diffu-
6
(a) Diffusion for (b) Request load for (c) Diffusion for two (d) Request load for two
one flood one flood floods (first file) floods (first file)
800
800
400
300
600
600
Group size
Group size
# of caches
# of caches
300
200
400
400
200
standard standard standard standard
100
200
200
100
probabilistic probabilistic probabilistic probabilistic
0
0
0
200000
400000
600000
800000
1000000
2000
4000
6000
8000
200000
400000
600000
800000
1000000
2000
4000
6000
8000
Request # Max load Request # Max load
Figure 2: The effects of probabilistic forwarding in one flood ((a) and (b)), and in two concurrent floods of equal intensity
((c) and (d)). (a) and (c) graph cache diffusion during the evolution of the two experiments, as achieved by calibrating the
push threshold in the probabilistic experiments to 220; the standard experiments used a threshold of 500. (b) and (d) show
the cumulative load distributions for the two flood scenarios with and without probabilistic forwarding.