"Sina Weibo is continuously saving costs by using Function Compute to process image files. We do not need to reserve a large number of idle machine resources to handle traffic surges during peak hours any more. Our engineers do not need to waste time on infrastructure management, such as monitoring server status. Instead, they can focus on working with our product teams to increase business value."

Featured Products

Function ComputeObject Storage Service - OSSAlibaba Cloud CDN
01

About Sina Weibo


Sina Weibo is a social media platform that is aimed at helping users build better connections. It provides a simple and unprecedented way for users to create posts in real time. Users can interact with each other and connect with people all over the world through viral yet informative content.
02

Challenge


Activities such as "Flying Red Envelopes", New Year's Day, and Spring Festival Gala pose big web traffic-processing challenges to Sina Weibo every year. These activities are characterized by bursty high traffic peaks, with each traffic peak lasting for about 3 hours. Activities such as celebrity events and "Flying Red Envelopes" often cause higher traffic peaks than common events. To cope with the massive traffic peaks, Sina Weibo adopted two methods to ensure the availability of these activities. The first method was to reserve sufficient servers for redundancy. The other method was to downgrade nonessential and peripheral services. Although these methods work, they come with multiple disadvantages. For example, Sina Weibo has to estimate the related IT costs in advance, manually handle unbalanced service loads, and perform complex and time-consuming capacity scaling in real time. In addition, Sina Weibo faced regular traffic imbalances on a daily basis. For example, during the afternoon on workdays, the number of online users is relatively low, which also means the number of access requests is relatively stable and low. In the evening on the other hand, many users will be online to read and create posts during their commute, so the number of access requests surges. Because of this cyclical consumption pattern, Sina Weibo experiences peak hours and off-peak hours; the web traffic load for peak hours can reach over 5 times higher than that of off-peak hours.
03

Why Alibaba Cloud


To address the challenges of traffic surges, Sina Weibo decided to adopt a solution that uses serverless architecture based on the public cloud. Alibaba Cloud Function Compute is a serverless computing platform that is provided by Alibaba Cloud to dynamically allocate execution environments based on the number of access requests. This platform can schedule computing resources within milliseconds to ensure a stable latency during peak hours and high resource utilization during off-peak hours. Only the computing resources used during function invocation incur fees. Furthermore, Function Compute can be seamlessly integrated with Object Storage Service (OSS) to process image files stored in OSS in real time. The features of Function Compute such as auto scaling, event-triggered functions, and pay-as-you-go billing method perfectly match the requirements of Sina Weibo. Therefore, Sina Weibo decided to use Function Compute for image file processing. Sina Weibo stored the image files uploaded by users to Alibaba Cloud OSS, and wrote functions for customized image file processing. When a Sina Weibo user requests to access an image file through a client, the access request is sent back to Function Compute through Alibaba Cloud CDN. Then, the related function downloads the source image file from OSS, processes the image file as required based on the client type, and then returns the processed image file to the user.
04

Architecture


Function Compute calculates the number of computing resources within milliseconds to ensure a stable latency for applications even when activities that incur high traffic peaks occur. This solution does not sacrifice user experience regardless of how many access requests are initiated. Sina Weibo is continuously saving costs by using Function Compute to process image files. We do not need to reserve a large number of idle servers to handle traffic surges during peak hours any more. Our engineers do not need to waste time on infrastructure management, such as monitoring server status. Instead, they can focus on working with our product teams to increase business value.
05

Looking Forward


The number of active Sina Weibo users has been increasing in recent years. By the end of 2019, Function Compute had already been processing billions of access requests from Sina Weibo on a daily basis. With the rapid growth of its business, Sina Weibo will continue to use Function Compute to allocate more execution environments through auto scaling.