7.1 Target environment
7.4.2 Document preparation
I next evaluated how well Spectra supports the Latex document preparation system. Latex’s resource requirements differ markedly from those of Janus. Latex performs less computa- tion per operation, but reads and writes a larger number of files. Since some of the input files are likely to have been modified on the client, data consistency is important.
120 CHAPTER 7. REMOTE EXECUTION Energy 0 10 20 30 40
Energy (Joules)
Local Remote A Remote B Spectra SThis figure shows Latex energy usage when preparing a 14-page document in the energy resource scenario described in Section 7.4.2. The first three bars show energy usage for each possible execution location. Spectra selected Remote B, so that alternative is marked with a “S”. The final bar shows energy usage when Spectra is used to select the best location. Each bar represents the mean of five trials—the error bars show 90% confidence intervals.
Figure 7.9: Latex energy usage for the small document
I ran Spectra servers on the laptop and on two remote servers; server A had a 400 MHz Pentium II processor, server B had a more powerful 933 MHz Pentium III processor. Thus, there are three possible alternatives: local execution on the laptop, remote execution on server A, and remote execution on server B. The laptop communicated with the servers using a 2 Mb/s 2.6 GHz wireless WaveLAN network.
I used two documents for evaluation: the smaller document was 14 pages in length, and the larger was 123 pages. I first executed Latex 10 times on each document to allow Spectra to learn application resource requirements. I then measured how well Spectra performed when preparing the documents in four different resource scenarios.
Figure 7.7 shows the measured execution time for preparation of the smaller document. The first data set shows the baseline scenario, in which all computers have no significant CPU activity and are connected to wall power. All files needed for document preparation are cached on every machine. Since little data is transmitted over the network, CPU speed is the primary consideration in this scenario. Remote execution proves faster than local execution, with server B preparing the document more quickly than server A due to its faster processor. As shown by the “S” above the third bar, Spectra chooses to use server B. The fourth bar in the data set shows that the time used by Spectra to choose the correct
7.4. VALIDATION 121 Energy 0 20 40 60
Energy (Joules)
Local Remote A Remote B Spectra SThis figure shows Latex energy usage when preparing a 123-page document in the energy resource scenario described in Section 7.4.2. The first three bars show energy usage for each possible execution location. Spectra selected Remote B, so that alternative is marked with a “S”. The final bar shows energy usage when Spectra is used to select the best location. Each bar represents the mean of five trials—the error bars show 90% confidence intervals.
Figure 7.10: Latex energy usage for the large document
execution plan is minimal. Figure 7.8 shows similar results for the larger document. In the file cache scenario, server B does not have any document input files cached locally. The execution of Latex is delayed while it fetches files from the server. Figures 7.7 and 7.8 show that file cache misses greatly increases the time needed to execute Latex on server B. Spectra correctly anticipates this and switches execution to server A for both documents.
In the reintegrate scenario, a 70 KB input file for the smaller document is modified on the client. Before preparing the smaller document on a remote server, Spectra must ensure that the modified input file is reintegrated to the file servers. As Figure 7.7 shows, rein- tegration over the wireless network significantly increases execution time for both remote execution options. Since the modification already exists on the client, the speed of local execution is unaffected. Spectra therefore chooses to use the local execution plan for the smaller document.
The modified source file is not an input for the larger document. As Figure 7.8 shows, Spectra predicts that the modified file will not be needed and does not force reintegration. Spectra therefore chooses the fastest plan: execution on server B. In this scenario, data- specific prediction allows Spectra to choose the fastest execution plan for each document.
122 CHAPTER 7. REMOTE EXECUTION
Baseline File cache CPU
0 20 40 60 80 100 Percentile 11 words 23 words 35 words 47 words 59 words
This figure shows the accuracy of Spectra’s choices for how and where to execute Pangloss-Lite operations. It shows results for five different sentences translated in three resource scenarios. In each case, the 100 possible alternatives available to Spectra are ranked by their utility—the height of each bar gives the percentile into which Spectra’s choice falls. Thus, a height of 99 indicates that Spectra’s choice is in the 99th percentile. Each bar represents the mean of five trials. The error bars show 90% confidence intervals.
Figure 7.11: Accuracy of Spectra choices for Pangloss-Lite
The energy scenario is identical to the reintegrate scenario, except that the client is disconnected from wall power and a very aggressive goal for battery lifetime is specified. For the smaller document, Spectra chooses server B, even though this takes more time to execute. Figure 7.9 shows the reason for this choice: remote execution on server B uses slightly less energy than the other options. Because energy is of paramount concern due to the aggressive battery goal, Spectra opts for energy savings over a smaller execution time. The choice for the larger document is much clearer, since execution on server B saves both time and energy.