1/6

A concurrency limit is the only knob that actually bounds a service. Threads, connections, database handles — something is finite, and if you do not choose the number the machine chooses it for you badly: a 500-thread pool spending its life in context switches, or a pool exhausted by one slow dependency while every other endpoint on it goes dark.

A limit layer holds a permit count. When the permits are gone it must choose between two policies, and that choice is this lesson:

  • shed — reject immediately with a documented code from the -32000..-32099 range
  • queue — hold the request until a permit frees

Both fail the same requests here. Only one of them spends the backend's time doing it.