Posts

Showing posts with the label reading-group

OSTEP Chapter 9: Proportional Share Scheduling

Image
The Crux: Fairness Over Speed.  Unlike the schedulers we explored in Chapter 8 (like Shortest Job First or Multi-Level Feedback Queues) that optimize for "turnaround time"  or "response time", proportional-share schedulers introduced in this Chapter aim to guarantee that each job receives a specific percentage of CPU time. (This is part of our series going through OSTEP book chapters. ) Basic Concept: Tickets Lottery Scheduling serves as the foundational example of proportional-share schedulers. It uses a randomized mechanism to achieve fairness probabilistically. The central concept of Lottery Scheduling is the ticket . Tickets represent the share of the resource a process should receive. The scheduler holds a lottery every time slice. If Job A has 75 tickets and Job B has 25 (100 total), the scheduler picks a random number between 0 and 99. Statistically, Job A will win 75% of the time. The implementation is incredibly simple. It requires a random number generat...

OSTEP Chapter 8

The crux of this chapter is how to schedule tasks without perfect knowledge. If you remember from  the previous chapter , the core tension in CPU scheduling is these two conflicting goals: Minimizing Turnaround Time: Usually achieved by running shorter jobs first (SJF). Minimizing Response Time: Usually achieved by Round Robin scheduling (RR). Essential for interactive users. Unfortunately, the OS does not have a crystal ball. It doesn't know if a process is a short interactive job or a massive number-crunching batch job. The Multi-Level Feedback Queue (MLFQ) solves this by encoding/capturing information from history of the job, and assumes that if a job has been CPU-intensive in the past, it likely will be in the future. As we'll see below, it also gives a chance for jobs to redeem themselves through the boosting process. I really enjoyed this chapter. MLFQ, invented by Corbato in 1962, is a brilliant scheduling algorithm. This elegant solution served as the base scheduler fo...

OSTEP Chapters 6,7

Image
How does your computer create the illusion of running dozens of applications simultaneously when it only has a few physical cores? Wait, I forgot the question because I am now checking my email. Ok, back to it... The answer is CPU Virtualization. Chapters 6, 7 of OSTEP explore the engine behind this illusion, and how to balance raw performance with absolute control. The OSTEP textbook is freely available at Remzi's website if you like to follow along. Chapter 6. The Mechanism: Limited Direct Execution The crux of the challenge is: How do we run programs efficiently without letting them takeover the machine?  The solution is Limited Direct Execution (LDE) --the title spoils it. "Direct Execution" means the program runs natively on the CPU for maximum speed. "Limited" means the OS retains authority to stop the process and prevent restricted access. This requires some hardware support. To prevent chaos, hardware provides two execution modes. Applications run in ...

OSTEP Chapters 4,5

Image
I recently started reading "Operating Systems: Three Easy Pieces" (OSTEP) as part of Phil Eaton's offline reading group . We are tackling a very doable pace of 2 chapters a week. The book is structured into three major parts: Virtualization, Concurrency, and Persistence. It is openly accessible to everyone for free, which is a tremendous contribution to computer science education by the Arpaci-Dusseau couple (Remzi and Andrea). This is a very user-friendly book, sprinkled with a lot of jokes and asides that keep the mood light. The fourth wall is broken upfront, the authors talk directly to you, which is great. It makes it feel like we are learning together rather than being lectured at. Their approach is more than superficial; it inspires you, motivates the problems, and connects them to the big picture context. The book  builds scaffolding through "The Crux" of the problem and "Aside" panels. It actively teaches you the thought processes, not just t...

Deep reading

How many hours does it take you to read a ~10 page research paper? — Murat Demirbas (Distributolog) (@muratdemirbas) February 8, 2022 Twenty years ago, a well-known professor in computer networking field told me that he reviews any paper in 30 minutes. Not just read the paper, but also write the review, mind you. All in 30 minutes! I said "I am slow it takes me 4 hours to read a paper". I lied. It actually took me 8+ hours to read papers, because I was a graduate student and didn't have much background and paper reading experience. Things have improved, but it still takes me 4-8 hours to read a paper and understand everything so I can write an informative conference review or blog post about the paper. (Of course, I am talking about good research papers, not content-free publication for the sake of publication papers.) Maybe because of that early encounter with that flamboyant networking professor, I always felt I am very slow in reading a paper. I checked with fellow ...

Sundial: Fault-tolerant Clock Synchronization for Datacenters

Image
This paper appeared recently in OSDI 2020 . This paper is about clock synchronization in the data center. I presented this paper for our distributed systems zoom meeting group . I took a wider view of the problem by explaining time synchronization challenges and fundamental techniques to achieve precise time synchronization. I will take the same path in this post as well. It is a bit circuitous road, but it gives a scenic pleasurable journey. So let's get going. The benefits of better time synchronization For any distributed system, timestamping and ordering of events is a very important thing. Processes in a distributed system run concurrently without knowing what the other processes are doing at the moment.  Processes learn about each other's states only by sending and receiving messages and this information by definition come from the past state of the nodes. The process needs to compose the coherent view of the system from these messages and all the while the system is movi...

Read papers, Not too much, Mostly foundational ones

Here is my advice to people who want to develop competence and expertise in their fields. Read papers By papers, I mean technical research papers, not white papers or blog posts.  By read, I mean read rigorously and critically .  Not too much If you read rigorously and critically, you cannot read too many papers.  Moreover, learning by doing is the only way to internalize and grok a concept. If you read papers all day, you don't have time to try things yourself.  If you are a PhD student, maybe read two or three papers a week (but, remember, rigorously and actively). If you are not in academia, maybe read one paper a week or two.    Mostly foundational ones While there are exceptions, it is better to prioritize: seminal work over incremental work, general principled work over point-solutions, work introducing techniques/tools over work applying techniques A big exception is good expository papers. Unfortunately, the academia treats them as something the cat...

High availability in cheap distributed key value storage

Image
This paper is authored by Thomas  Kim, Daniel Lin Kit, Gregory Ganger, Michael  Kaminsky, and David Andersen. It appeared in SOCC 2020. The paper talks about using NVMM for building a distributed key value store. NVMMs are a new technology. They are slowly rolling into the datacenters, but there are still questions about their performance and how many writes it could handle before a write wear. NVMMs have very low latency comparable to DRAM, yet they are 10 times cheaper. Awesome, right? Unfortunately they don't have the same high bandwidth as DRAM or SSDs. Also, they are still not anywhere as cheap as SSDs, and it may not be affordable to want to build all NVMM key-value stores.  Before reading this paper, it is important to understand that this is all about money, money, money. The cost of NVMM and SSDs influences the design decisions, and lead to this non-straightforward heterogeneous design. If cost was not an issue, we could even have DRAMs for all replicas in K-V ...

Ocean Vista: Gossip-Based Visibility Control for Speedy Geo-Distributed Transactions

Image
This paper occurred in VLDB'19 and is authored by Hua Fan and Wojciech Golab.  The paper is about providing strict serializability in geo-replicated databases. The technique it uses can be summarized as "geo-replicate-ahead transactions". First the transaction T is replicated to all the parties across the datacenters. The parties then check to see that the watermark rises above T to ensure that all transactions including and preceding T has been replicated successfully to all the parties. Then, the execution of T can be done asynchronously at each party. This should remind you of the SLOG paper :  SLOG uses a deterministic architecture to move most of this communication outside of conflict boundaries, enabling these transactions to be processed at high throughput. More specifically, SLOG relies on deterministic processing to avoid two phase commit. Once all parties agree to the plan, processing occurs (mostly) independently on each node, with the system relying on the pl...

My Distributed Systems Seminar's reading list for Fall 2020

For the Fall semester distributed systems seminar, we will discuss these papers: Bipartisan Paxos: A Family of Fast, Leaderless, Modular State Machine Replication Protocols eXtreme Modelling in Practice     Starling: A Scalable Query Engine on Cloud Function Services Lambada: Interactive Data Analytics on Cold Data using Serverless Cloud Infrastructure   Tiered Replication: A Cost-effective Alternative to Full Cluster Geo-replication   Scalable State-Machine Replication   Designing Distributed Systems Using Approximate Synchrony in Data Center Networks   Armada: Low-Effort Verification of High-Performance Concurrent Programs   Ocean Vista: Gossip-Based Visibility Control for Speedy Geo-Distributed Transactions   Consolidating Concurrency Control and Consensus for Commits under Conflicts    Tales of the Tail: Hardware, OS, and Application-level Sources of Tail Latency   Near-Optimal Latency Versus Cost Tradeoffs in Geo-Distributed St...

The Impact of RDMA on Agreement

Image
This paper appeared in PODC 2019. PODC stands for Principles of Distributed Computing. It is a theoretical distributed systems conference, first established in 1982. I had published my first ever paper, " Resettable Vector Clocks " at PODC 2000. The conference was held in Portland and, as a fresh graduate student attending it, I was awe-struck at the conference. On day one of the conference, I saw Leslie Lamport interrupting a talk asking a question and protesting loudly. Then Keith Marzullo in the audience (I think) pointed out the misunderstanding and Leslie Lamport said "Nevermind" and calmed down. I also noticed that the person sitting next to me was, oh my God, Nancy Lynch! I couldn't believe my luck seeing all these distributed systems royalty in person. Also in this conference, on day three, Eric Brewer gave his CAP theorem talk.   Good times! Anyways, back to the paper.  Contributions of the paper Under the message-passing model, BFT consensus requires ...

Popular posts from this blog

Hints for Distributed Systems Design

The Agentic Self: Parallels Between AI and Self-Improvement

Learning about distributed systems: where to start?

5 Lessons at 50

Foundational distributed systems papers

Building a Database on S3

Cloudspecs: Cloud Hardware Evolution Through the Looking Glass

Aurora DSQL: Scalable, Multi-Region OLTP

TLA+ modeling tips

Supporting our AI overlords: Redesigning data systems to be Agent-first