Weibo Image Storage Architecture and High‑Performance Image Processing Pipeline
The article describes Weibo's large‑scale cross‑IDC distributed image storage system, its upload and download workflows, the challenges of massive seasonal traffic spikes, and the custom pipeline and lightweight compression library designed to achieve strong consistency and low‑latency image delivery.
Images are a core content element on Weibo, accounting for nearly 60% of daily posts, and the platform now handles over 30 million image uploads per day and more than 100 billion stored images.
The Weibo image‑bed is a massive cross‑IDC distributed object storage platform that implements multi‑master write disaster recovery, allowing any data‑center failure to be quickly switched to another site. It uses an internal BOR (Business Object Replication) protocol combined with eventual consistency and real‑time proxy to provide strong consistency to end users.
When a user uploads an image, the request first hits the Upload API service. Common images are pre‑compressed, then stored in an SSD‑based persistent cache called iCache, which uses two consistent hash rings for high availability. After iCache succeeds, asynchronous messages trigger storage check‑in and remote replication. The image is finally persisted in Sina’s custom notfs user‑space file system, offering three times the throughput of traditional file systems with constant low‑latency access.
For downloads, a global CDN serves the majority of requests. When a CDN cache miss occurs, the request reaches the Download API service. iCache is checked first; if the image is present it is returned immediately. If not, the system fetches the image from the remote data center via a dedicated link, ensuring strong consistency. The image may then be real‑time compressed to meet presentation requirements.
During the Chinese New Year celebration, the image‑bed faced a 30‑fold traffic surge, prompting architectural improvements rather than pure scaling. The key challenge was the CPU‑ and memory‑intensive image compression step.
To address this, the team built a pipeline‑based online image processing system called webpress . It separates the compression stage from I/O stages, allowing asynchronous I/O and controlled allocation of CPU and memory resources. Tests show that under high concurrency, webpress maintains stable latency while traditional PHP + ImageMagick solutions experience severe latency spikes.
For the compression logic itself, the team created a lightweight library named webimg . By using delayed decoding, JPEG pre‑resampling, addition‑instead‑of‑multiplication tricks, and SIMD optimizations, webimg achieves nearly four times the performance of ImageMagick without memory leaks, and it is being extended to support GPU CUDA and potential FPGA integration.
In conclusion, architectural optimizations across storage, caching, and image processing enable Weibo to meet short‑term resource constraints, improve user experience, and reduce operational costs during massive traffic events.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.