image: "assets/arch_elephant_yell_v2.png"
---
# 6.1.2 The Elephant Yell (IPC)

When the Postgres Cafe first opened in the late 1990s, the kitchen was run by completely isolated chefs. If a massive banquet order (a huge query) came in, a single Chef would try to chop all 10 million onions by himself.
Eventually, Postgres introduced **Parallelism** (and later, Logical Replication). Suddenly, the Head Chef could hand the order to four separate Sous Chefs so they could chop onions simultaneously.
But this created a new acoustic problem: **Inter-Process Communication (IPC)**.
## The Yelling Match
When four elephants are working on the same dish in a loud kitchen, they have to yell across the room to coordinate.
"I've finished my pile of onions!"
"Has anyone seen the salt?"
"I'm ready to assemble the final dish!"
This communication is not instantaneous. In the world of Postgres Wait Events, the time an elephant spends standing still, cupping an ear, and trying to hear a colleague over the din of the kitchen is categorized as an **IPC Wait**.
## The Checkpoints of Parallelism
If you see a query dominated by **IPC** waits, your database is not struggling with Disk or Memory. It is struggling with the *overhead of coordination*.
- **`IPC:ParallelMessageQueue`**: The Head Chef (the Leader process) has assigned out all the chopping, but now he is just standing by the window. He is aggressively waiting for the Sous Chefs (Parallel Workers) to yell that they are done and hand him their Tupperware of chopped onions.
- **`IPC:MessageQueueReceive`**: One Sous Chef has finished chopping and is trying to hand his Tupperware up the chain, but the person catching it is busy. The chop is done, but the hand-off is stalled!
The paradox of the Parallel Kitchen is that sometimes, assigning four cooks to a small task takes longer than assigning one cook. The time it takes to explain the recipe, chop the onions, and yell back and forth can completely eclipse the time it would have taken one elephant to just do it quietly.
## Logical Replication (The Long-Distance Call)
IPC doesn't just happen inside the kitchen; it extends to branch locations!
If you are running **[[Chapter 4/4.3 - The Town Crier (Logical Replication)|Logical Replication]]**, your kitchen employs a Publisher who bundles up finished recipes and yells them over a telephone line to a Subscriber kitchen across the world.
If the telephone line crackles, or the Subscriber kitchen is taking too long to write down the recipe, your Publisher will freeze. It triggers an `IPC` block while waiting for acknowledgment.
> [!info] Diagnostics: The Elephant Yell (IPC)
> Is your parallel query or logical replication stalled by communication breakdown? Explore the **[[Workloads/IPC/_IPC|IPC Event Library]]** to decode exactly what your workers are trying to yell to each other.
Whenever you see a high frequency of IPC waits, ask yourself: Is the problem the *size of the work*, or simply *the number of cooks attempting to talk*?
---
| ← Previous | ↑ Table of Contents | Next → |
| :--- | :---: | ---: |
| [[Chapter 6/6.1.1 - The Waiting Waiter (Client & Timeout)\|6.1.1 The Waiting Waiter (Client & Timeout)]] | [[Learn You a Postgres for Great Good\|Home]] | [[Chapter 6/6.1.3 - The Invisible Staff (Activity & Extensions)\|6.1.3 The Invisible Staff (Activity & Extensions)]] |