Uploading Instagram Videos with 94% LESS CPU
Now it's easier to spend even more time on the platform
tldr;
Instagram used to compress the same video twice for all users (progressive and adaptive bit rate).
They realized they could save time by…
first compressing the video to progressive encodings
Then convert that progressive encoded video into an adaptive-bit-rate video.
Results: The entire process uses 94% less resources.
🙋♀️ Credit to The Original Author
Wrote the awesome original article this was summarized from on improving Instagram compute time. He’s an amazingly talented engineer and you can learn more about his experience and senior+ skills at🤔What’s the problem?
Instagram needs to maintain video formats for all users.
The formats include.
Minimum Functionality type Progressive encodings for all older Instagram apps.
Minimum Functionality type Adaptive Bit Rate for older Instagram apps that can support bit rate streaming.
Advanced Functionality type encodings for high quality videos for newer Instagram apps.
Minimum functionality type encodings take most of the CPU resources where in 1 year no infrastructure could scale to support this growth.
⚙️Requirements
Continue to support progressive encodings for older Instagram devices. This means to be backwards compatible.
Continue to support adaptive bit rate encodings for older Instagram devices. This also means to be backwards compatible.
Scale and extend advanced encodings for higher quality videos for devices that can play the videos. Give users the best performance if they can handle it.
Minimize resource consumption for progressive or adaptive bit rate encodings to scale. Be efficient with your CPU usage.
🚧 The Big Design
🏁 How it started
Instagram used to use the same file and transcode it TWICE from the original source for minimum functionality type videos.
Encoding from the same file is resource intensive because it has to start the encoding from scratch both times. It wasn't leveraging work it already did!
The big insight was that transcoding the file to progressive encodings made it extremely quick to encode it to the advanced ABR format.
🏎 How it’s going
Instagram realized this when they learned the progressive and ABR encodings used the SAME codec.
Of course the tradeoff was that the adaptive bit rate streaming versions were lower quality. But the big focus is to scale for advanced functionality types.
Now they're able to do that!
💰 HELP WANTED
This newsletter has grown to 18,000 → 18,500 AMAZING READERS. It’s grown to a scale that a single person can’t maintain all of it on their own.
If you’re interested in being a byte-sized design writer, apply here!
👨⚖️ Official Article
A link to the official article and source! Subscribing is the best way to support the newsletter!
Keep reading with a 7-day free trial
Subscribe to Byte-Sized Design to keep reading this post and get 7 days of free access to the full post archives.