an energy consumption framework for distributed java-based systems
DESCRIPTION
An Energy Consumption Framework for Distributed Java-Based Systems. Chiyoung Seo Software Architecture Research Group University of Southern California. Contents. Motivation JVM Platform and Life Cycle Energy Consumption Model Computational Cost Communication Cost - PowerPoint PPT PresentationTRANSCRIPT
An Energy Consumption Framework for Distributed Java-Based Systems
Chiyoung SeoSoftware Architecture Research Group
University of Southern California
Contents
Motivation JVM Platform and Life Cycle Energy Consumption Model
Computational Cost Communication Cost
Design Time Energy Estimation Runtime Energy Estimation Conclusion
Motivation (1/2)
Newly emerging computing platforms (PDAs, cellular phones, wearable computers)
Limited battery resources Distributed mobile applications require much battery p
ower in these platforms Energy-aware initial deployment of software components Dynamic adaptations of software components during runtime
Framework for estimating the energy consumption of software components is necessary
Both during system construction time and during runtime
Motivation (2/2)
Host 1 Host 2
Host 3 Host 4 Host 5
1 2
34
5
67
89
1011
12
13 14
15 16
17 18
1920
21 22
2324
2526
2627
2829
30
PDA (Linux
)
Laptop (Window XP)
PDA Cellular phone(Window CE)
Cellular phone
Encryptioncomponent
10 Joules/invocation
15 Joules/invocation
JVM Platform and Life Cycle
Java Applications
Java Class Libraries(Base, AWT, net, …)
Java Virtual Machine
Native Libraries
Operating System
Start JVM
InitializingJVM
Loadingthe main class
Interpreterloop
Exit
Main thread
GC thread
Energy Consumption Model Modeling a system’s energy consumption at
the level of its software components Allows the dynamic adaptation of a entire software
system at the component levels Energy consumption of a software component
Computational energy cost Communication energy cost
Computational energy cost CPU processing and memory accesses
Communication energy cost Data exchange among software components over
the network
Computational Energy Cost (1/4)
Focusing on a component’s constituent interfaces
H1
C1 …
I1
I2
In
C4
C2
C6
C3
C5
C7
H2
H3
H4
1 11 1
1
( , ) ( , )
: total # of interfaces for a component
: total # of invocations for an interface
( , ) : computational energy consumption for the invocation of
imn
comp ii j
i i
i th
EC c h CompEC I j
n c
m I
CompEC I j j
iI
Computational Energy Cost (2/4)
Effect of invoking an interface Represented as the execution of 256 Java bytecode types as well as
native methods (e.g., java.io.FileInputStream.read() ) In a multi-threaded environment, monitor enter/exit operations for syn
chronizing multiple threads are also executed Energy consumption for the jth invocation of a component c1’s interf
ace I1
255
1 , ,0 1
,
,
( , )
: # of each type of bytecode executed during the invocation
: # of each native method executed du
m
k j k l j l j monitork l
k j th
l j
CompEC I j bNum bEC fNum fEC mNum E
bNum k j
fNum l
ring the invocation
: # of the monitor operations executed during the invocation
: Energy consumption of executing each type of bytecode
: Energy consumption of executing each native
th
j th
k
l
j
mNum j
bEC
fEC method
: Energy consumption for a monitor operationmonitorE
Computational Energy Cost (3/4)
Garbage collection During the garbage collection, all threads except a GC thread withi
n a JVM process stop temporarily Estimating its energy consumption (Joules)
Monitor the total time tgc spent by a GC thread during an interface’s invocation
Multiply tgc by the avg. power pgc (Joules/sec.) during the garbage collection
Implicit OS routines are generally invocated while user applications are being executed
Context switching (including timer interrupt and rescheduling), page faults, page reclaims
Should be added into the computational energy cost
Computational Energy Cost (4/4)
255
1 , ,0 1
,
( , )
: Average power consumption during the garba
m
k j k l j l j monitork l
gc gc j j j j
gc
CompEC I j bNum bEC fNum fEC mNum E
p t CSNum CSEC PFNum PFEC PRNum PREC
p
,
ge collection
: Total time spent by a GC thread during the invocation
: # of context switching events during the invocation
: # of page faults occurred during the invocation
gc j th
j th
j th
t j
CSNum j
PFNum j
: # of page reclaims occurred during the invocation
: Energy consumption of processing a context switching event
: Energy consumption of processing a page fault
: Energy consump
j thPRNum j
CSEC
PFEC
PREC tion of processing a page reclaim
Communication Energy Cost (1/3)
H1
C1 …
I1
I2
In
C4
C2
C6
C3
C5
C7
H2
H3
H41 11 1
1
( , ) ( , )
: total # of interfaces for a component
: total # of invocations for an interface
( , ) : communication energy consumption for the invocation of
imn
comm ii j
i i
i th
EC c h CommEC I j
n c
m I
CommEC I j j
iI
Communication Energy Cost (2/3)
Energy Consumption for remote communication
Component c1’s interface I1
kernel’s networking subsystem
Wireless InterfaceCard
Component c2
kernel’s networking subsystem
Wireless InterfaceCard
Wirelessrouter
Host 1 Host 2
User-to-kernel copy cost
TCP/IP processingcostKernel-to-WICcopy cost
Radio Communication
cost
Communication Energy Cost (3/3) Suppose during the jth invocation of an interface I1 on Host 1
Host 1 transmits dt bytes of data to Host 2 Host 1 receives dr bytes of data from Host 2
If there are no communication failures, and the avg. transmission/ receipt BWs on Host 1 in interacting with Host 2 are bt and br bytes/sec, respectively
Energy consumption on Host 1 due to the transmission
If the avg. bandwidth is reduced to bt /2 bytes/s, then Energy consumption on Host 1 due to the receipt
Communication energy cost due to the jth invocation of I1
2t t tm d c t
: Energy consumption to send a unit of data (1 byte)
: Network communication start-up cost
t t t t
t
E m d c
m
c
1( , ) ( )t t t r r rCommEC I j m d c m d c
r r r rE m d c
Design Time Energy Estimation (1/3)
Computational energy cost for a component For each target host, the following information should be available
Energy consumption (Joules) of each bytecode and native method, a monitor operation, and implicit OS routines
Average power (Joules/sec) during the garbage collection This is just an one-time effort
JavaComponents
PDA (iPAQ)
Power Supply
DigitalMultimeter
Data CollectionComputer
Experimental setup
Design Time Energy Estimation (2/3) Identifying three types of component interfaces
An interface requiring almost the same amount of computation regardless its input parameters
Count the number of bytecodes, native methods, monitor operations, and implicit OS routines only once for an arbitrary input
At the same time, monitor the time spent by a GC thread An interface whose input size is proportional to the amount of computatio
n required Use multiple regression technique
An interface whose input parameters have no direct relationship to the amount of computation
Generate a set of random inputs using the test input generation tools Count the number of bytecodes, native methods, monitor operations, and impl
icit OS routines executed for each input Monitor the time spent by a GC thread for each input
Multiple regression for the find interface of Shortest-Path component
Estimated (J)
Actual (J)
119767
122688
Point 1
261905
245395
Point 2
351300
364891
Point 3
224201
215760
Point 4
341570
316622
Point 5
677319
710709
Point 6
X2 (Num. of edges)
Y (E
nerg
y, μ
J)
Y (E
nerg
y, μ
J)
X1 (Num. of nodes)
1
2
3
4
5
6
1 2 3 4 5 6 7 8 9 10
SHA MD5 IDEA
Median
Filter
LZW Sort DB Shortest path
AVL
Linked List
Error rate=(calculated value – measured value) * 100 / measured value
- 8
- 6
- 4
- 2
0
2
4
6
1 2 3 4 5 6 7 8 9 10
Err
or
rate
(%
)
Design Time Energy Estimation (3/3)
Communication energy cost for a component For each target host, mt, mr, ct, and cr values should be avail
able for arbitrary BWs bt and br bytes/sec.
If available BWs are reduced to bt /2 and br /2 bytes/sec,
t t t t
r r r r
E m d c
E m d c
2
2
t t t t
r r r r
E m d c
E m d c
Transmission energy estimation on an iPAQ with 240 KB/sec BW and no communication errors
1.8546 0.015t tE d
Runtime Energy Estimation
0
20
40
60
80
100
120
140
10 20 50 100 200
Size of Data (KB)
Energ
y (J
oule
)
Actual240 KB/sec120 KB/sec
DBClient
iPAQ (host A)
Power Supply
Digital multimeter
Data CollectionComputer
Wirelessrouter
IBM X22 laptop(host B)
Desktop server(host C)
FTPClient
IDEA
LZW
DBServer
IDEA
FTPServer
IDEA
LZW
0
20
40
60
80
100
120
140
1.5 3.6 5.6 9.8 15.1
Frequency (times/sec)
Energ
y (J
oule
)
Actual240 KB/sec120 KB/sec
Conclusion
Suggested the framework for estimating the energy consumption of Java-based systems
Modeling the system energy consumption at the component’s level
Framework is applicable both during system construction time and during runtime
Showed very good precision on the whole (within 5% of actual energy consumption)
Plan to emulate various communication failures using emulation tools (e.g., Dummynet)