Energy Consumption of Mobile Offloading for JavaScript Applications Chaoran Xu, Yuansong Qiao, Brian Lee, Niall Murray Software Research Institute, Athlone Institute of Technology, Athlone, Ireland Email: {cxu, ysqiao, nmurray} @research.ait.ie,
[email protected]
Abstract—With the significant increase and the availability of functionality via mobile devices and applications, a key problem of limited computation capabilities and short-life battery has arisen, Mobile Cloud Computing(MCC) has been emerged as a potential solution to the limitations of mobile devices. Within MCC research, mobile JavaScript offloading has been proposed as a solution for saving energy on mobile devices. It achieves this by offloading computationally intensive tasks to the Cloud. In this paper, energy consumption is evaluated by offloading JavaScript applications from mobile devices to cloud servers. The experiments are carried out by offloading computation intensive sorting functions. The results show the energy-efficiency of mobile JavaScript offloading on mobile device and also imply some factors affecting mobile JavaScript offloading.
processing power” but also “extends the battery life” on the mobile device. [4] By reducing the workload on mobile devices, the power consumption should be reduced. To achieve this energy efficiency on mobile devices, researchers have developed methods using mobile offloading technology. Some of the proposed solutions migrate the computation from mobile device to an application-layer virtual machine that is abstract computing machine providing hardware and operating system independence.[5] Some other solutions offload the computation-intensive part of code to a distributed server, a proxy or a cloud server, which have great capability for computing.[6] With both of these solutions, the energy of mobile device is saved as mobile client does not need to consume much energy to perform intensive calculations.
Keywords—Mobile Cloud Computing; JavaScript Offloading; WebSocket;
Mobile offloading solutions presents for different developing languages and platforms. There is also requirement of offloading for mobile JavaScript applications as the popularity of mobile users and popularity of JavaScript in the mobile application development.[7] Among the topic of mobile offloading for JavaScript applications, researchers proposed different solutions but there is no evaluation of energy consumption during the offloading for this topic. In this paper, we try to find the main factors affecting energy-efficiency of offloading solution by evaluating the energy consumption of a mobile JavaScript offloading solution with various network conditions and server performance. The aim of this study is to provide a design reference for developing an offloading decision method to implement a dynamic offloading system.
I.
INTRODUCTION
The concept of access to content anytime, anywhere and on any device has become a reality due to the proliferation of mobile devices. With Rich Mobile Application, Resource Intensive Mobile Application [1] and other mobile application development technologies, mobile devices not only assist users’ daily life but also enable users have similar functions of desktop computers. However, the user experience is restricted by the limited battery life and low-performance hardware on the mobile devices, comparing with the hardware on desktop. Mobile Cloud Computing is described as a new paradigm for mobile applications whereby the data processing and storage are moved from the mobile devices to powerful and centralized computing platforms located in clouds. [2] Mobile Cloud Computing will lead a new generation for mobile application development. Some of most popular mobile applications have already applied this exciting technology, such as Google Drive, Dropbox, and other similar mobile cloud storage applications, enable their users to store more personal data in the cloud rather than only on their mobile devices. OnLive [3] is a technology company which provide a cloud gaming platform for gamers who don’t have a high equipped gaming machine. The users can play those games on their low performance machines or even on mobile devices (It is currently compatible with Android, and the OnLive Desktop applications for iOS is another product of this company.) as the OnLive running these games in the cloud server and then rendering streams to users through the Internet. From mobile devices’ point of views, Mobile Cloud Computing not only “improves data storage capacity and
The rest of this paper is structured as follows. Section II discusses about recent researches in Mobile Cloud Computation Offloading fields. The offloading process used in the paper is included in section III. In Section IV, the experimental design is described and the test results are analyzed in Section V. The conclusion and future work are in Section VI. II.
RELATED WORK
In [8], the MAUI architecture for energy saving by finegrained code offloading is presented. The system uses “code portability” to generate another version of mobile application for only running remotely on the infrastructure. MAUI system could identify the most computing-intensive method in this mobile application by “programming reflection and type safety” and extracts those methods when system needs to offload. The profiler function in MAUI system could profile continuously each method of the mobile application at runtime according to the measurements of wireless connectivity and CPU working environment. Depending on the profiling results, the system
decides whether to execute locally or remotely on the infrastructure server side. However, this solution is written in C# and only supports applications written for the Microsoft .NET Common Language Runtime. This would make the system lack of flexibility for web application comparing with JavaScript language.
Fig. 1 describes the sequence process of the offloading framework. After user choosing which offloading server to use and press offloading button, the mobile device will connect to server through WebSocket firstly. The offloading message is sent to server as the connection set. Offloading message is different depending on offloading times from the mobile client.
PIOS is a proposed solution [9] uses a proxy server between the mobile client and the web server. Every time mobile client sending request to the web server, the proxy server will check response first. If the response does not contain any offloading annotation, the proxy will redirect this response to mobile client. Otherwise, the proxy server will generate a process for executing annotated computational codes; meanwhile, it also sends a lightweight web to mobile client. Then mobile client only sends offloading request with its object to proxy server and proxy server running that process and sends results back to mobile client. However, the proxy server in this framework might spend extra time on detecting the offloading annotation and generating a lightweight web for mobile client. Extra time might lead to more energy consumption as the screen display of mobile device is on when mobile user waiting for response.
For the first time offloading from one mobile client, the message consists of: “first-time offloading flag”, computational function code and parameters.
Another solution [10] proposed an offloading framework with a mechanism for automatic partitioning UI-related and computation segments of a mobile application. This mechanism also includes a process with interface that allows programmers customize the offloading when an exception happened as reaching the network limits. The experiments with both real world situation and simulation workload shows this solution performance in decreasing the response time and energy consumption. However, this paper mainly focuses on the automatic partition mechanism before the offloading computation on mobile device. And the partition process might cost extra time or even energy which might affects the efficiency of offloading solution. In an addition, the experiment with real world situation is not described sufficiently in the whole offloading process. The RMCC [11] framework contains one of important components, the ASMobiC. ASMobiC is Adjacent Servicebased Mobile Cloudlets and the provider of fine-grained mobile service. It hosts the RESTful services for mobile client asynchronously invoke. Moreover, it comprises mainly “offthe-shelve outdated or damaged-yet-functioning mobile devices” and it is supervised by Mobile Network Operators. However, the ASMobics might restraint the performance of this framework as mainly out-of-date and damage-yet-functioning phones still have limited resource and computation ability comparing to desktop computers. It might a good solution for reusing these electronic resources but the performance would be enhanced significantly if using desktop computers or server for this RESTful mobile cloud service. III.
INTRODUCTION OF THE OFFLOADING PROCESS
The offloading process is completed by our previous work, the mobile computation offloading framework (MOJA) [12], using Node.JS [13] at the server side and WebSocket [14] for communication between mobile clients and offloading servers. It is all implemented by JavaScript, so it fits for all the JavaScript mobile applications.
Next time offloading for this mobile client, the message contains the “first-time offloading flag”, the name of computational function and parameters. All messages are formatted in JSON [15]. The server accepts connection and receives the offloading message. Then, server will check the flag message of whether first-time offloading. If this is the first time offloading from this mobile client, the server then deserializes the JavaScript code of computational function and parameters, stores and executes them. Afterwards, server sends results back to the mobile client. Otherwise, the server knows this mobile client has offloaded before. The server just executes the function with parameters as described in the offloading message. After executing those computational functions, server sends results back to mobile client.
Mobile Client
Offloading Server
Setting up Connection
Connection Accepted
Offloading Computation functions & Parameters Checking for the first time offloading & Code Execution Sending Results Back
Fig. 1. Offloading Procedure.
IV.
EXPERIMENTAL DESIGN
Based on the offloading process, the experiment is designed as follows:
A. Client Side The client side is the mobile device. The two most popular mobile platforms are chosen for the experiment, one latest Android smartphone and one latest iOS iPhone. See in TABLE I. . TABLE I. CPU
Google Nexus 6
Apple iPhone 6
Qualcomm Snapdragon 805 Quad-core 2.7 GHz Krait 450 Apple A8 Dual-core 1.4 GHz Cyclone(A RM v8based)
TEST PHONES SPECIFICATIONS RAM
OS
Battery
3GB
Android 5.0
3220 mAh
1GB
iOS 8.0
1810 mAh
C. Energy Measurement PowerTutor [20] is a mobile application for monitoring battery usage on Android devices. It runs at background for recording power consumption of all the running applications including itself. For iOS devices, the measurement is different as there is no application like PowerTutor for iOS. The method is recording the energy consumption percent (P stand) of standby with Wi-Fi on during the offloading solution and Wi-Fi off during the local execution for a period of time (T stand), then using the energy consumption percent (P app) of test application minus result of Pstand multiply Tstand/Tapp (which means the time cost of test application). The equation is: P Papp [(TappTstand)Pstand ]
This Server Side Offloading servers are set up from different places on the PlanetLab Europe [16]. Three servers at different places are chosen. These servers are distributed at Athlone, Waterford, and Bangkok. The user could choose which server to offload, when using the offloading framework. See in TABLE II. TABLE II.
the computation will be offloaded to. Then both of that two computation-intensive functions, initialization with random integers and sorting, will be offloaded to the chosen server.
OFFLOADING SERVER SPECIFICATIONS RTT (ms)
Model
Athlone