Study of Architectural Choice Impact on Software Sustainability Ruzanna Chitchyan Ahmed H. Obeid Helge Janicke Department of Computer Science Department of Computer Science Software Technology Research University of Leicester University of Leicester Laboratory, Gateway House Building University Road University Road De Montfort University Leicester, UK Leicester, UK Leicester, UK +44 (0)116 252 3828 ahoo1@student.le.ac.uk +44 (0)116 257 7617 rc256@le.ac.uk heljanic@dmu.ac.uk ABSTRACT for such analysis to be introduced. Finally, the original In this paper we explore how the choice of software architecture requirements are represented as use-cases, which are publicly can affect software energy use and CO2 emissions – two specific available. Besides, HW has also been used in a variety of issues related to software sustainability. empirical studies [5, 6], allowing for future work on integration of current findings with past study results. Keywords Software architecture, software energy use, software 3. HEALTH WATCHER: Study of sustainability. Alternative Architectures The current implementation of the HW system uses the client- 1. INTRODUCTION server architectural style. Yet, the client-server architecture has 2 Software architecture is the structure of the system, which quite distinct variants – the thick and thin client architectures. We comprises software elements, their externally visible properties, set out to see how differences in sustainability-related and the relationships among them [1]. Today software requirements will result if one or the other of these two flavors of architectural patterns (or styles) are used for solving some the client-server style were used. Figures 1 and 2 respectively frequently repeated problems. For instance, the Blackboard style present these styles for the HW system is used where a centrally maintained knowledge repository must be updated by a large number of users. The main requirements a) The thin client version of the architecture is presented in supported via this style are knowledge sharing, maintainability, Figure 1. Here the architecture contains 3 main changeability, and reusability of knowledge components. On the components: the client who only processes a display- other hand, the client/server architecture supports distributed capability, the server that hosts the application logic, and applications, where a number of (often geographically) distributed the database that hosts the generated data. The client has users request and use services provided by a server. This style is no processing capability, so all processing will take place particularly well suited for centralised delivery of frequently used, at the application server side, with data served through repeated functions computed over a large dataset (e.g., carrying database server. Thin client cannot be operational when out money transfers for banking applications, sending emails, disconnected from the application and database servers. etc.). b) The thick client version of the client-server architecture In this paper we explore the effects that a choice of software is presented in Figure 2. Here the application logic and architecture has on energy efficiency, and CO2 emissions GUI are deployed on the same physical machine on the properties of a software system. We use, as a case study, the client side. The client also maintains a local database. Health Watcher (HW) [2] - a previously developed system, which This database is synchronized with the main database had no specific consideration of sustainability. located at a different physical machine. At the same time, this style retains a local database, which allows for an Two architectural styles, both able to support the off-line data access, when it is necessary. requirements of this system are realised for this case study. The resultant architectures are then evaluated for their impact on Measuring the influences of how an architectural style can sustainability. affect the system sustainability is important for selecting the most sustainability-inductive architecture. Two particular measures: 2. OVERVIEW OF HEALTH WATCHER energy efficiency and CO2 emissions are used for this study (note, Health Watcher [2] is a web-based information system for response time and cost were also calculated, but are not discussed public health monitoring and complaint registration developed here due to space limits): and presently used in Brazil. The system allows citizens to report Electricity consumption calculates the power that each type complaints, and query information on diseases, health service of architecture will consume for the implemented system. Since units, and previously made complaints. This case study was each type of architecture runs on some hardware, this metric will selected because it met a number of key criteria relevant to this consider two types of end user devices (one for thin client and one study. Firstly, HW is a real and non-trivial system and so enables for thick client) and measure the power they consume per day. We credible conclusions to be drawn. Secondly, the HW system has take a note of processor utilisation as well, since it substantially been developed without explicit note of sustainability, allowing affects energy consumption. The energy required to operate the system server will also be considered. The result of this per-day • Server power consumption 520w max, 200 w in idle (no calculation, if multiplied by 365, will estimate annual power load) mode. consumption. Thus: • Number of users per hour: 3, each using for 3 min. Energy consumption = user devices consumption + system • Time between use and standby: 3 min. servers consumption + cooling system servers (1) The energy use per the thick/thin client-server styles, calculated based on Equations (1) and (2) is shown in Table The CO2 emissions metric uses the previously defined 1 below. The calculation accounts for processor utilization energy consumption to estimate the annual CO2 emissions during the day. produced via the given architectural solution. The amount of When looking at the total energy consumption by each energy consumption is multiplied by 0.65 which represent how architectural style with use of 50 client devices (as per Table much CO2 emissions are produced from one KW of electricity in 1), we observe that the thick client-server variant uses above the UK [8]. Thus: 3.5 times the energy of the thin one. This is also a trend that is set to grow with increase of the client devices in use. CO2 emission = total energy consumption * 0.65 (2) However, we should also expect that due to its strong In this calculations we use details on hardware power reliance on server processing, the thin client-server variant consumption provided by the producers [9] as well as details on will require and additional server resource much sooner if the the energy utilisation provided by study from Cornell [4]. number of users grows substantially. Hardware and usage parameters for the devices are: (note, here a Due to our used calculation, the CO2 emissions are set of samples is used, but each system should be evaluated with directly proportional to the consumed energy, so again, the its own relevant data for power consumption etc.): thin client version will emit 3.5 less CO2 in the given scenario. • thin client Dell Wyse T10 and • Dell desktop (GX 280 + LCD monitor 17). Wyse T10 4. CONCLUSION (keyboard+ 1 ps/2 mouse+ monitor) whose energy In this paper we set out to study how the choice of an consumption is a round 7.2 Watt [8,9] architectural style affects two specific properties of software • Number of users: 50 system’s sustainability: it’s energy use and CO2 emissions. • Number of hours worked per day: 9; We then sketched the evaluation using two versions of the client-server architecture. Figure 1: HW case study: thin client version of client-server architecture Figure 2: HW case study: thick client version of client-server architecture Our study so far shows that there is a very clear affect [3] Bresciani, P., Perini, A., Giorgini, P., Giunchiglia, F., & that even the hardware configuration used to support a Mylopoulos, J. (204). Tropos: An agent-oriented software chosen style will have on the system’s sustainability. development methodology. Autonomous Agents and Multi-Agent The next step in this work will be to take a finer-grain Systems, 8(3), 203-236. look at the architectural influence, e.g., studying it through [4] Computer energy usage facts, university of Cornell.ULR: use case-based evaluation. Moreover, additional evaluation http://computing.fs.cornell.edu/Sustainable/fsit_facts.cfm Accessed criteria, such as response time, usability, cost should be at [12-04-2014]. integrated into the suite of evaluation metrics for a more [5] P. Greenwood, T. T. Bartolomei, E. Figueiredo, M. Dósea, A. F. representative picture for all sides (i.e., including social, Garcia, N. Cacho, C. Sant’Anna, S. Soares, P. Borba, U. Kulesza, economic, and environmental) of sustainability concern. and A. Rashid. On the impact of aspectual decompositions on design We are also aware about the need to consider a number stability: An empirical study. In ECOOP, pages 176–200, 2007. of threats to the validity for such a study, including issues of [6] Bianchini, R., & Rajamony, R. (2004). Power and energy hardware selection, number of users, etc. These concerns will management for server systems. IEEE Computer, 37(11), 68-74.. be of focus in more detailed studies. [7] J. Cabot et. al: Integrating sustainability in decision-making processes: A modelling strategy. ICSE Companion 2009: 207-210 5. REFERENCES [8] M. Berners-Lee, “How bad are bananas?: the carbon [1] B Bass, L., Clements, P., & Kazman, R. (203). Software architecture footprint of everything.” Greystone Books Ltd., 2011. in practice. Addison-Wesley Professional. [9] Dell Wyse T class technical report, URL: [2] S. Soares, P. Borba, E. Laureano, Distribution and persistence as as- http://www.wyse.co.uk/sites/default/files/products/spec_sheets_2012 pects, Software: Practice and Experience 36 (7) (2006) 711–759. -05/Dell-Wyse-T-class-IA.pdf Accessed at [2-06-2014] Table 1: Calculation of Energy Consumption per Architectural Style Thick Client Idle Active Standby 116 w 175 w 2w Assume: 9 h working day, 3 users use system per hour 81 minutes 81 minutes 21.3 hours and each spend 3 min per query. The system then stays (3*9*3=81) (3*9*3=81) (24h - 2*81 min) in idle more for 3 minutes then goes to stand-by mode. Client Energy use per state per a day 116w *1.35h=156.6 w/h 175w*1.35h=23 2 w * 21.3 h= 42.6 6.25w/h w/h Client Energy use per a day 156.6 + 236.25 + 42.6 = 435.45 w /d Server with Thick Client Average (40% utilization) Active Idle Note: given consumption for the no load and max load (520–200)*40/100 + 520w 200w states the average utilization at 40% (n=40%) is 200= 320* 0.4 +200= 328 calculated as (Pmax–Pmin)* n/100 + Pmin [6,9] w Assume: same time in each state as the client device 81 minutes 81 minutes 21.3 hours (above), however, the server with a thick client does not use max utilization in active state, but uses the average rate. Server Energy use per a day 2.7 h * 328 + 21.3h*200 = 5,145.6 w per day Thick Client-Server: total energy per day with 50 client 435.45 *50 + 5,145.6= 26918.1 w per day devices Thin Client Idle time Active time Standby time Assume: 9 h working day, 3 users use system per hour 81 minutes 81 minutes 21.3 hours and each spend 3 min per query. The system then stays (3*9*3=81) (3*9*3=81) (24h - 2*81 min) in idle more for 3 minutes then goes to stand-by mode. Because there is no research found explained how much 7.2 w * 0.4 = 2.88 w 7.2 w 7.2 w * 0.2 = 1.44 thin client consume power in idle and standby state we w assume at idle it consume 40% of its power consumption and 20% at standby state Energy use per state per a day 2.88 w * 1.35 h=3.88 w/h 7.2w * 1.35 h= 1.44w*21.3h= 9.72 w/h 30.672w/h Total energy use per day 3.88 w+ 9.72 w + 30.672 w = 44.272 w/d Server with Thin Client Average (40% Active Idle utilization) Note: given consumption for the no load and max load 520–200)*40/100 + 520w 200w states the average utilization at 40% (n=40%) is 200= 320* 0.4 calculated as (Pmax–Pmin)* n/100 + Pmin [6,9] +200= 328 w Assume: same time in each state as the client device 81 minutes 81 minutes 21.3 hours (above), however, the server with a thin client uses max utilization in active state, but uses the average rate. Server Energy use per a day 1.35 h * 328 + 1.35*520+21.3h*200 = 5,404.8 w per day Thin Client-Server: total energy per day with 50 client 44.272 w *50 + 5404.8 = 7,618.4 w per day devices