Share on Facebook Tweet on Twitter Share on LinkedIn Share by email
Tuning Smartphone Performance
October 31, 2010 6:00 PM PT

When enterprise systems need to run faster, performance engineers can work the magic of load balancing, caching, and code optimization to gain scalability and improved response time. Performance tuning is a well-established IT practice that extends to web servers, application servers, local-area networks, and virtual private networks, which makes it rather surprising when a research paper titled A First Look at Traffic on Smartphones—to be presented during the 2010 Internet Measurement Conference, being held Nov. 1-3 in Melbourne, Australia—lays claim to being the first-ever study of traffic as observed on smartphones.

Surely the performance-tuning gurus already have jumped into this new arena and collected the data necessary for performance analysis, right?

Not so, says Ratul Mahajan, researcher with the Networking Research Group (NRG) at Microsoft Research Redmond.

Smartphone performance-analysis team
The team at Microsoft Research Redmond that produced the first-ever study of smartphone traffic (from left): Srikanth Kandula, Ratul Mahajan, and Dimitrios Lymberopoulos.

Mahajan and co-authors Hossein Falaki and Deborah Estrin of UCLA, fellow Microsoft researchers Dimitrios Lymberopoulos from the Network Embedded Computing Group, and NRG colleague Srikanth Kandula discovered that despite the phenomenal growth rate of smartphones, there has been little data collection concerning their usage patterns. There have been studies on smartphone HTTP traffic, based on aggregated data gathered from the network side. Data gathered from individual devices however, has been nearly nonexistent.

“We lacked the most basic measures,” Mahajan explains, “such as how many minutes of activity does the smartphone user average per day, or how long does each interaction last, and how much traffic does the average user generate? In the traditional server world, workload profiles are well understood; once you know that, you can tune the system. Our contention is that we cannot begin to tune for performance without first understanding usage characteristics.”

This type of information is of critical interest to device manufacturers, network operators, and mobile operating-system developers—all the players who contribute to the user experience. Smartphone sales have been rising faster than sales of other mobile devices, and new research suggests that the number of smartphones browsing the Internet in the United States today has surpassed browsing by non-smartphones. This steep climb in smartphone usage lends urgency to studies that can help the industry determine best practices for optimizing the smartphone ecosystem.

The researchers had ventured into smartphone usage with an earlier project that studied user interactions; the resulting paper, Diversity in Smartphone Usage, was presented in June during the eighth annual International Conference on Mobile Systems, Applications and Services.

“That first paper delivered very basic factors around usage,” Lymberopoulos says, “because so little was known and we needed to establish a broad picture around questions such as average minutes of usage per day, which applications get used most often, how much traffic do users send and receive, battery consumption, and other behavior patterns.”

This led the team to focus on network traffic as a follow-on project. Along with the display, CPU, and memory, the 3G radio is one of the device’s main energy consumers. The researchers wanted to understand traffic characteristics, with the goal of improving both traffic performance and reducing energy drain during data transfer.

Smartphone, Anyone?

The biggest challenge for the study was logistical: Despite offering the use of free phones with unlimited data plans, the researchers found it difficult to recruit enough users to make up a statistically valid data set.

“When people have their own smartphone,” Mahajan says with a rueful smile, “they don’t want the inconvenience of changing. They are used to a specific operating-system version and certain hardware features, or they’ve customized the settings. We ended up with a mix of users running their own phones and users on phones we handed out. Recruiting users was a very manual process, and I believe this is part of the reason why studies like this have not been done before.”

The actual data collection also posed considerable challenges, this time technical. Falaki was the primary developer of a logging tool to install on smartphones that would capture packet-level traces. He built two versions: one for the Android platform and one for Windows Mobile.

“For one thing, they were very different code bases,” he recalls. “Then, the logging tools had to be robust enough to run continuously and still be lightweight enough that users would not notice significant impact on energy consumption or response time.”

The team collected 532 days of data from 44 users, more than sufficient to begin their analysis. Experienced in wired-network traffic measurements, they began with basic metrics that would provide traffic characteristics, such as packet size, traffic sent over 3G versus Wi-Fi, data traffic received versus sent, and applications used.

Identifying Traffic Bottlenecks

The researchers were able to confirm that browsing is the dominant data activity for smartphones, generating about half the traffic, while email and maps were each responsible for about 10 percent.

One significant finding was that most smartphone data transfers are small, with a median size of 3 KB. A high number of small transfers increase the overhead for lower-layer protocols, and the researchers found that, for half the data transfers, header bytes constituted more than 12 percent of the total bytes used. For data transfers that used transport security, this overhead could reach as much as 40 percent of the total transfer size. As a result, lower-layer handshakes represented 20 percent of the total completion time for half the data transfers.

The team also gained more insight into performance problems over 3G networks. While the researchers understood that such networks have long latencies and high loss rates, their analysis revealed that packet loss was the primary culprit limiting the throughput of smartphone data transfers. More surprisingly, 25 percent of downlink transfers were bottlenecked by the size of the sender-side transport buffer.

“This was an unexpected finding,” Mahajan says. “It appears that the servers handling smartphone clients may not be tuned appropriately for this type of traffic. A quarter of the connections appear to be limited by how the server is configured. Fortunately, by changing simple server parameters to do with static buffer sizes, network operators could actually boost performance.”

Extending Battery Life

One critical aspect of mobile-device performance is power consumption. Long battery life affects not only the user, but also device manufacturers, which are under competitive pressure to cram as many components as possible into a small package. Cameras, touch screens, Bluetooth radios, and even tiny, status-light LEDs all drain the battery. 3G radios are one of the major power consumers in any mobile phone, and manufacturers devise “power save” policies that shut down radios when there is no user activity.

The nature of data traffic, however, is what determines the efficacy of a smartphone’s power-management policy. The performance problem that surfaces with 3G radios is that a long timeout period unnecessarily drains the battery, while a quick timeout might impact the user’s perceived response time. A “sleeping” 3G radio typically takes 1.5 to 2 seconds to “wake up,” then establishes a connection, and sends or receives a data packet. This timeout period significantly affects user response time and power consumption. Is there a way to achieve a better balance?

“We can’t predict the time between packets transferring in or out of the phone,” Lymberopoulos says. “From our data sets, we know this is user-dependent. So we studied traffic patterns at the packet level and found that, across all users, a timeout value of 4.5 seconds appeared to save on power with none to minimal increase in response time. Some devices, however, default to a timeout of 17 seconds. We ran simulations that set this value to 4.5 seconds and saw that the 3G-radio energy dissipation reduces by approximately 35 to 40 percent. Given that 3G radio is one of the most energy-demanding components of the device, these are significant savings.”

“By doing this,” Kandula adds, “we knew we risked hurting user response time for packets coming in after 4.5 seconds. Happily, it turned out that only 2 to 5 percent of packets actually sustained that 1.5- to 2-second delay. So, with a simple change to power-management policies, manufacturers could reduce power consumption by 35 to 40 percent while delaying only 2 to 5 percent of the actual traffic.

“The precise configuration values—in this case, the 4.5-second timeout—will change with traffic profiles. However, this analysis shows understanding the traffic and appropriately configuring the phone as a methodology can yield significant power savings.”

Vision: Adaptable Performance Profiles

The larger lesson for the team was that smartphone performance optimization requires tuning across multiple layers, from hardware to operating system to the network operator’s server. Traffic is particularly interesting, because optimal results require coordination between the mobile operator and the phone itself. No one player individually can make a difference.

The researchers hope their work will encourage others in mobile computing to engage in further data collection and analysis of smartphone traffic. To this end, the logging tools developed for this research are available upon request.

Asked to speculate on how smartphones should evolve to deliver better performance, Mahajan offers one word: “adaptable.”

“In a perfect world, your phone should change after you use it for a while,” he says. “The performance profile needs to be learned and tuned in situ, according to the profile of the specific user, rather than any demographic information.”