Hacker News new | ask | show | jobs
by tadkar 1996 days ago
I am going to massively over simplify, but here goes. The really big idea from control theory is the idea of negative feedback. This basically boils down to measuring the output of your system and making the input to the system some function of the difference between the input signal and the output. The parent post refers to PID control. This refers to the three types of commonly used things to do with the difference (or error) signal.

P is for proportional - where you just multiply the error signal with a constant. What this does is to encourage the system to track the level of the input signal (but potentially with some lag)

I is for integral. This is where you integrate the difference signal over time. What this does is to reduce the lag between the input and output signal D is for derivative. This is where you feed back in the derivative of the error signal What this does is to damp down the swings in the system especially those that come from being too aggressive with the above two knobs.

Good controller design often comes down to picking the right weights for each of the three types of feedback functions you can input into the system. So in this example, it might be that you distribute your requests to servers based on how over or under loaded the servers are...

2 comments

It's unclear to me how a PID controller applies to the problem described in the article: having each client choose a subset of backend tasks in a way that will be stable for a long time. PID controllers deal with a scalar setpoint, scalar measured variable, and scalar control output and adjust frequently. How is that helpful at all in choosing this subset? It's certainly not a straightforward application of standard literature that the authors completely ignored, as suggested by siscia's grandparent comment.

> So in this example, it might be that you distribute your requests to servers based on how over or under loaded the servers are.

They had a working approach to distributing requests to servers, described at the beginning of the article. It's sessions (aka connections or channels in Google's literature) they're focusing on.

Responding also to siscia's grandchild comment:

> Or you can spin up more machines. The integral and derivative part will tell you when spinning up more machines or when to tear down the one you already got!

You're describing something like Google's autopilot, which I just linked to in another comment. A PID controller might make sense there, but it's only tangentially related to the problem described in this article.

I personally was thinking to apply a controller to each client machine and making it control the number of connections to the backend.

You can control for the P90 latency and increase or decrease the number of connections to backend machines.

Similarly the backend can decide to drop connections if it see that the latency of the reply is too high, or if the CPU is too high or whatever other metrics make sense.

I don't see if a similar system would ever reach a stable-enough state.

Are integral and derivative important for server load balancing? If you can't handle a sudden increase in load then we need to implement throttling, rather than load-balancing.
Or you can spin up more machines.

The integral and derivative part will tell you when spinning up more machines or when to tear down the one you already got!