liveBook · Manning

Co-location

As explained in Latency

Colocation is the placement of communicating systems or services in the same physical facility or nearby location to reduce communication distance.

Colocation places components that communicate frequently closer together to reduce latency. The first placement decision is often between machines: a nearby database can save more time per request than an application-level optimization. The same principle applies within a machine, where CPU, memory, cache, and network-stack placement affect access time. section 3.1

Move the data closer

A web application querying a database 6,000 km away incurs about 60 ms of network round-trip latency per request. Moving the database into the application's data center reduces query latency to under 10 ms. Embedding a database in the application removes that network communication entirely; a REST API server with embedded SQLite is one such arrangement. section 3.0 section 3.6

Work from the largest communication distances inward:

  • Place communicating services closer together. CDNs and edge computing similarly move data or computation toward users. section 3.1 section 3.6
  • Then consider multicore placement: keep a CPU core's data on its local NUMA node, and account for cache and network-stack latency. section 3.1 section 3.6
Figure 3.2 Geographic latency. The geographic distance between two nodes implies latency. For example, Hibernia Express advertises 60 ms round-trip between New York and London. Light travels the same distance in vacuum in 19 ms, so the minimum theoretical round-trip latency is 38 ms.
Figure 3.2: Geographic latency. The geographic distance between two nodes implies latency. For example, Hibernia Express advertises 60 ms round-trip between New York and London. Light tarvels the same distance in vacuum in 19 ms so the minimum theoretical round-trip latency is 38 ms.

The New York–London comparison shows why distance imposes a latency floor: the cited 60 ms network round trip exceeds the 38 ms theoretical round trip for light in a vacuum. Moving a service closer does not necessarily remove last-mile latency. section 3.2.1

How Latency covers it

How deep it goes
Explains internode and intranode placement choices and physical latency constraints, without specifying a deployment procedure in the supplied evidence.
Examples
Compares remote and same-data-center databases, and cites an REST API with embedded SQLite and exchange-adjacent trading servers.
What it assumes
Assumes familiarity with latency as a performance metric and with modeling and measuring it.
What you can do after
Evaluate/understand where moving communicating services or colocating compute and memory may reduce latency, while recognizing last-mile limits.
How it connects
Connects colocation to distributed systems, CDNs, edge computing, NUMA, CPU caching, and network stacks.

Also explained in

Compare how 2 books explain co-location →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.