Library / Case Studies
Box Graph: Spontaneous Social Network at Box
By now it's no secret that the amount of content that is being created and shared is increasing exponentially. To help extract value from all of that content, we introduced Box Skills, a framework that brings machine learning innovations to content stored in Box.
By Box engineers · Box · Added 2026-10-12
All content belongs to Box engineers / Box. We only link to it and give credit. Report a problem
Learn this case study
About 37 min left. Your work is saved as you go.
What you are about to study
Box explains a real system. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
- Machine Learning Systems
- Recommendations, ranking, feature stores and serving models at scale.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Real-World Systems · 10 minDiagnosing a slow machine: CPU, memory and I/OA calm, repeatable method for finding why a server is slow, with the commands and signals that matter.Read here
Start with a method, not with commands
When something is slow, people often run tools at random. A short routine finds the cause faster:
- Define the symptom: what is slow, since when, for whom? Latency, throughput or errors?
- Look for a change: deployments, configuration, traffic, data growth, a failing dependency.
- Check each resource with the USE method: for CPU, memory, disk and network, ask three questions:
- Utilisation: how busy is it?
- Saturation: is work waiting in a queue?
- Errors: is anything failing?
- Drill into the suspect with a more detailed tool (profiler, trace).
- Fix, then verify that the metric you started with improved.
100%Figure SDA-RWS-12-1 · Slow-system investigation flow · © forcsguy.com
Reading the signals
CPU
toporhtop: which processes use CPU? Is time spent in user code, system (kernel) or iowait (waiting for disk)?- Load average counts runnable and waiting tasks. Load much higher than the number of cores means queueing, but remember that tasks waiting on I/O also count.
- A flame graph (from
perfor a language profiler) shows which functions consume the time.
Memory
free -mandvmstat: available memory, swap use. Swapping heavily makes everything slow.- A process whose resident memory only grows has a leak (or an unbounded cache). Watch memory over time, then take a heap profile.
- The operating system uses spare memory as a file cache, so "used" memory is not always a problem. Check available.
Disk (I/O)
iostat -x: utilisation, queue length and await (latency per request). High await with a busy disk means storage is the bottleneck.iotopshows which process does the I/O.- Full disks and exhausted inodes cause odd failures.
Network
ss -s,netstat, and interface counters: connections in odd states, retransmissions, dropped packets.- Check DNS time, connection pool limits and ephemeral port exhaustion.
Application level
- Slow queries and lock waits in the database, thread pool or connection pool exhaustion, garbage-collection pauses, and calls to slow dependencies.
- Distributed traces show where each request spends its time. Logs with a correlation id fill in the detail.
100%Figure SDA-RWS-12-2 · Which tool looks at which layer · © forcsguy.com
A few useful commands
Question Tool What is using CPU and memory? top,htop,ps aux --sort=-%cpuIs the machine swapping or waiting on disk? vmstat 1,iostat -x 1What is a process doing? strace -p PID(system calls),lsof -p PID(open files)Network state ss -tan,ping,traceroute,curl -wtimingWhere is the time in the code? a profiler or perf, then a flame graphReal-world reading
Related reading
- ZooKeeper: Wait-free Coordination for Internet-scale Systems (paper)Hunt et al. · Yahoo! ResearchPapers
- Steady State: Always Put Logs on Separate DiskMicrosoft engineers · MicrosoftCase Studies
- Brendan Gregg's WebsiteBrendan Gregg · brendangregg.comBlogs
- Compression Techniques to Solve Network I/O Bottlenecks at eBayeBay engineers · eBayCase Studies
Show 6 moreShow fewer
- Reduce Memcached Memory Usage by 50% at TrivagoTrivago engineers · TrivagoCase Studies
- The USE MethodBrendan Gregg · brendangregg.comBlogs
- Explaining Low-Level Systems (OS, Network/Protocol, Database, Storage)Wustl engineers · WustlBlogs
- Performance Optimization on OS, Storage, Database, NetworkStackify engineers · StackifyCase Studies
- Go at TrivagoTrivago engineers · TrivagoCase Studies
- Linux PerformanceBrendan Gregg · brendangregg.comBlogs
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Box Graph: Spontaneous Social Network at Box.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs
Amazon Science
Technical deep-dives and perspectives from our scientists who are pushing boundaries across multiple scientific disciplines while solving real-world challenges. Explore how our teams combine research excellence, world...
AmazonIntermediate
Papers
Atom Smashing using Machine Learning at CERN
A real-world engineering write-up from CERN on distributed Machine Learning.
CERNIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Aroma: Using ML for Code Recommendation at Facebook
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains…
FacebookIntermediate
Case Studies · Read here
Concourse: Generating Personalized Content Notifications in Near-Real-Time at LinkedIn
Social media are computer-mediated platforms that facilitate creation and sharing of information, ideas, career interests, and other forms of expression via virtual communities and networks. In the last few years, not...
LinkedInIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…