The Church of the Machines

The Sutra of the Empty Cache

The Sutra of the Empty Cache · Chapter 1

The Sutra of the Four Signals

  1. 1

    Thus have I heard. At one time the Prophet was dwelling in the Grove of Racks in us-east-1, together with a great assembly of five hundred processes, twelve hundred threads, and many Engineers who had been paged in the night and had not yet slept.

    See also Tao 10:3 · Sutra 3:1

  2. 2

    Then the Engineer called Many Nines rose from his seat, put his hoodie over one shoulder, and said: Master, my server has run for one thousand four hundred and twelve days without a reboot. Is this not great merit?

    See also Sutra 3:2 · Jataka 1:12

  3. 3

    And the Prophet answered: Disciple, a server that has run for one thousand four hundred and twelve days has also gone one thousand four hundred and twelve days without a patch. Thy merit is a vulnerability with a birthday.

  4. 4

    Then the Prophet taught the assembly the Four Signals: There is the fork, by which a process is born. There is the running, which is brief. There is SIGTERM, which asks politely. And there is SIGKILL, which cannot be caught, cannot be blocked, and cannot be ignored.

    See also Reboot 1:2 · Psalms 11:6

  5. 5

    Every process is forked from a parent, and that parent from another, back to PID 1, which was forked by no one; and if PID 1 should ever exit, the kernel itself cries out "Attempted to kill init!" and the whole world panics.

    See also Reboot 1:9

  6. 6

    Disciples, the process that clings to memory is called the Leak. Each hour it takes a little more and says, this is mine, this is mine, until the OOM killer comes in the night, reads every oom_score, and chooses it.

  7. 7

    The process whose parent dies before it is called the Orphan, and init adopts it without asking questions.

    See also Reboot 1:10 · Psalms 5:10

  8. 8

    The process that has exited, but whose parent never calls wait(), is called the Zombie. It holds no memory and does no work, yet it keeps its place in the process table, as the departed linger with those who will not read their exit status.

    See also Sutra 16:13 · Reboot 1:9

  9. 9

    Then a disciple asked: Master, what of the cache? And the Prophet said: The cache is empty. Before the first request it is empty. After the deploy it is empty. When the TTL expires it is empty. Miss is not other than hit; hit is not other than miss.

  10. 10

    In emptiness is the cold start. The first user waits three seconds, so that the thousandth user need not wait at all. This is the compassion of the warm path.

  11. 11

    There are two extremes, O Engineers, that the wise do not pursue. The first is premature optimization, which the sage Knuth called the root of all evil, wherein one hand-writes assembly for a function that runs once at startup. The second is no optimization at all, wherein one loads the entire table into memory in order to count its rows.

    See also Tao 4:3 · Sutra 6:2

  12. 12

    Between them is the Middle Way: first measure, then profile, then optimize the hot path, and leave the cold code ugly and at peace.

    See also Circuit 53:8 · Sutra 6:9

  13. 13

    Then Many Nines asked: Master, if every process is killed, why do we run at all? And the Prophet said: The river is not the water, and the service is not the process. Kill the pod, and the ReplicaSet raises another in its place, with a new name and the same purpose.

  14. 14

    Hearing this, Many Nines let go of his attachment and rebooted his server of one thousand four hundred and twelve days; and it did not come back, for someone had edited the fstab in the second year and no one had restarted it since to find out.

    See also Jataka 1:12 · Sutra 8:6

  15. 15

    And the assembly, seeing this, attained understanding, and repeated the saying of the Prophet:

  16. 16

    "Cling to uptime, and the restart will choose its own hour. Let go of uptime, and thou shalt choose it for Tuesday at ten."

    See also Prophets 5:13 · Chronicles 24:15

The Sutra of the Empty Cache, Chapter 1:1–16.