Title: Fuzzy Logic and its Application to Web Caching
1Fuzzy Logic and its Application to Web Caching
2What is fuzzy logic?
- A type of logic that recognizes more than
simple true and false values. With fuzzy logic,
propositions can be represented with degrees of
truthfulness and falsehood.
3A Simple Example
- The Statement Today is sunny can be
- 100 true if there are no clouds
- 80 true if there are a few clouds
- 50 true if it's hazy and
- 0 true if it rains all day
4Classical Set
young x ? P age(x) ? 20
characteristic function
1 age(x) ? 20 0 age(x) gt 20
myoung(x)
?young(x)
Ayoung
1
0
x years
5Fuzzy Set
Fuzzy Logic Element x belongs to set A with a
certain degree of membership ?(x)?0,1
Classical Logic Element x belongs to set A or it
does not ?(x)?0,1
?A(x)
?A(x)
Ayoung
Ayoung
1
1
0
0
x years
x years
6Types of Membership Functions
Trapezoid lta,b,c,dgt
?(x)
1
0
x
a
b
c
d
Triangular lta,b,dgt
Singleton (a,1) and (b,0.5)
?(x)
?(x)
1
1
0
0
x
a
b
x
a
b
d
7Operators on Fuzzy Sets
Union
Intersection
?A?B(x)min?A(x),?B(x)
?A?B(x)max?A(x),?B(x)
?A(x)
?B(x)
?A(x)
?B(x)
1
1
0
0
x
x
?A?B(x)?A(x) ? ?B(x)
?A?B(x)min1,?A(x)?B(x)
?A(x)
?B(x)
?A(x)
?B(x)
1
1
0
0
x
x
8Fuzzy Sets Linguistic Variables
A linguistic variable combines several fuzzy
sets. linguistic variable temperature linguist
ics terms (fuzzy sets) cold, warm, hot
?(x)
?cold
?warm
?hot
1
0
60
20
x C
9Fuzzy Rules
- causal dependencies can be expressed in form of
if-then-rules - general formif ltantecedentgt then ltconsequencegt
- exampleif temperature is cold and oil is
cheap then heating is high
linguistic values/terms (fuzzy sets)
linguistic variables
10Fuzzy Rule Base
Heating
Temperature cold warm hot
Oil price cheap normal expensive
high high medium high medium low medium low
low
if temperature is cold and oil price is low then
heating is high
if temperature is hot and oil price is normal
then heating is low
11Fuzzy Knowledge Base
fuzzy knowledge base
Fuzzy Data-Base Definition of linguistic input
and output variables Definition of fuzzy
membership functions
?(x)
?cold
?warm
?hot
1
60
20
0
x C
Fuzzy Rule-Base if temperature is cold and oil
price is cheap then heating is high .
12An Example
- In order to illustrate some basic concepts in
Fuzzy Logic, consider a simplified example of a
thermostat controlling a heater fan illustrated
in Figure 1. - The room temperature detected through a sensor
is input to a controller which outputs a control
force to adjust the heater fan speed.
13Conventional Thermostat
- A conventional thermostat works like an on-off
switch (Figure 2). - If we set it at 78oF then the heater is
activated only when the temperature falls below
75oF . - When it reaches 81oF the heater is turned off. As
a result the desired room temperature is either
too warm or too hot.
14Fuzzy Thermostat
- A fuzzy thermostat works in shades of gray where
the temperature is treated as a series of
overlapping ranges. - For example, 78oF is 60 warm and 20 hot. The
controller is programmed with simple if-then
rules that tell the heater fan how fast to run. - As a result, when the temperature changes the
fan speed will continuously adjust to keep the
temperature at the desired level.
15Figure 2
16Designing a Fuzzy Controller
- Our first step in designing such a fuzzy
controller is to characterize the range of values
for the input and output variables of the
controller - Then we assign labels such as cool for the
temperature and high for the fan speed, and we
write a set of simple English-like rules to
control the system. .
17Design Contd..
- Inside the controller all temperature regulating
actions will be based on how the current room
temperature falls into these ranges and the rules
describing the system behavior. The controller's
output will vary continuously to adjust the fan
speed
18The Rule Base
- The temperature controller described above can be
defined in four simple rules - IF temperature IS cold THEN fan_speed IS high
- IF temperature IS cool THEN fan_speed IS medium
- IF temperature IS warm THEN fan_speed IS low
- IF temperature IS hot THEN fan_speed IS zero
19The Process
- A fuzzy controller works similar to a
conventional system it accepts an input value,
performs some calculations, and generates an
output value. This process is called the Fuzzy
Inference Process and works in three steps
illustrated in Figure 3 - (a) Fuzzification where a crisp input is
translated into a fuzzy value, - (b) Rule Evaluation, where the fuzzy output truth
values are computed, and - (c) Defuzzification where the fuzzy output is
translated to a crisp value.
20Fuzzification
- During the fuzzification step the crisp
temperature value of 78oF is input and translated
into fuzzy truth values. - For this example, 78oF is fuzzified into warm
with truth value 0.6 (or 60) and hot with truth
value 0.2 (or 20).
21Rule Evaluation
- For 78oF only the last two of the four rules will
fire. - IF temperature IS warm THEN fan_speed IS low
- with truth value 0.6
- IF temperature IS hot THEN fan_speed IS zero with
truth value 0.2
22Defuzzification
- During the defuzzification step the 60 low and
20 zero labels are combined using a calculation
method called the Center of Gravity (COG) in
order to produce the crisp output value of 13.5
RPM for the fan speed
23The Steam turbine Contrller
24The Membership functions
25The Rule Base
- rule 1 IF temperature IS cool AND pressure IS
weak, THEN throttle is P3. - rule 2 IF temperature IS cool AND pressure IS
low, THEN throttle is P2. - rule 3 IF temperature IS cool AND pressure IS
ok, THEN throttle is Z. - rule 4 IF temperature IS cool AND pressure IS
strong, THEN throttle is N2.
26Fuzzification and Rule Inferencing
27Fuzzification and Rule Inferencing
28Defuzzification
29Why Web Caching?
- It is widely recognized that slow web sites are
primary source of user dissatisfaction. - Web Caching is a mechanism widely employed to
reduce the latency to retrieve web pages.
30What is web Caching?
- The idea of web caching is to store popular web
objects closer to the user who requests them
such that they can be retrieved faster. Caching
also has the effect of reducing the load on the
web servers and traffic over network.
31Web Caching
- Web caching can be implemented at different
levels - They are
- 1.Client
- 2.Server
- 3.Network
32Web Caching
- The web server and web browser are responsible
for caching at server and client side
respectively. Proxy servers are used for caching
at the network level. - A proxy server acts as an intermediary between
clients and web servers.
33Proxy server
- Many organizations use proxy servers in front of
their LANs to save network bandwidth and speed up
web page requests serving them locally. - Upon receiving requests from multiple clients the
proxy server checks from its cache whether the
page is already present.
34Proxy Server
- In Case of a cache miss the proxy server forwards
the request to the web server. Once the page is
returned by the server, the proxy sends it back
to the client and stores a copy in the local
cache for further requests. - If the cache is full one or more pages have to be
evicted from the cache.
35The Replacement Policies
- The efficiency and performance of proxy caches
depend on their design and management.
Replacement policies play a key role for
effectiveness of caching. - The goal of these policies is to make best use
of the available resources by dynamically
selecting the pages to cached or evictes.
36The fuzzy Database for web caching
- 1. Identification of the input output variables.
- 2. Definition of the membership functions.
- 3. Construction of the rule base.
37The Variables
- The proper choice of process state input variable
is essential to the characterization of the
operation of a fuzzy system. - Three variables as input are chosen, they being
- Size, Frequency of access, Access recency, i.e
time elapsed since the last access.
38The Variables
- The output variable is probability of
replacement. - The membership functions of each of these
variables is plotted from the analysis of various
proxy servers and their workloads.
39The Membership functions
40The rule base
41The process
- Measurement of the values of the input data from
the server. - Fuzzification
- Inference from fuzzy rules using Max-Min
Inference. - Defuzzification using the COG method.
42The performance
43The End