Neki 每秒处理 1.18 亿次查询
118M Queries per Second on Neki

原始链接: https://planetscale.com/blog/118-million-queries-per-second-on-neki

为庆祝 Neki 平台预览版的发布,团队通过实现每秒超过 1.18 亿次查询(QPS)的稳定性能,成功验证了其强大的可扩展性。 测试从 5 个分片、100 万 QPS 的基准开始,最终扩展至 512 个分片,并保持了每个分片约 23.1 万 QPS 的稳定表现。此次破纪录的运行持续了 16 分钟,共处理了 1.22 PiB 数据,网络吞吐量超过每秒 2 Tb,客户端 p99 延迟为 13.95 毫秒。 该基准测试基于主架构,在 512 个 r8g.16xlarge 实例的 PostgreSQL 分片和 480 个 Neki 路由器上运行了只读点查询工作负载。测试中每秒仅出现 67 次错误,成功率约为 99.9999%,凸显了 Neki 通过增加分片数量实现吞吐量线性扩展的能力。公司计划发布后续文章,详细介绍实现这一超 1 亿 QPS 里程碑所克服的工程挑战。

PlanetScale 近期展示了其名为“Neki”的新型数据库平台,通过 512 个分片实现了每秒超过 1.18 亿次查询(QPS)的基准测试结果。该测试涉及 1.22 PiB 数据,并消耗了大量的 AWS 计算资源,这在 Hacker News 上引发了关于性能、成本和架构的激烈讨论。 批评者和用户主要针对以下几点进行了辩论: * **方法论:** 一些用户指出,该基准测试使用的是简单的点查询(Point Reads),这属于“理想情况”,忽略了跨分片连接或写入等更复杂的实际工作负载。 * **成本与透明度:** 实现该记录所需的高昂基础设施成本引发了关于其实用性的争议,一些用户质疑专有闭源数据库解决方案的价值。 * **开源与专有:** 当 PlanetScale 首席执行官 Sam Lambert 为公司的专有技术进行辩护,并反驳有关开源替代方案(如 Supabase)具有可比性的说法时,讨论变得更加激烈。他强调,Neki 目前的功能集已超越了开源竞争对手。 归根结底,这场讨论突显了数据库行业中一个普遍存在的矛盾:专有分片系统所提供的巨大规模与开发者社区对开源可访问性和可移植性的偏好之间,存在着权衡。
相关文章

原文

We released Neki in platform preview yesterday. To celebrate the release, we wanted to test out running 1 million queries per second on Neki. We hit this goal pretty quickly on 5 shards and decided to see how much further we could push it.

This next run ended with 512 shards running 118 million queries per second with 1.22 PiB of data.

The benchmark was very simple. A single-shard point select, one row fetched per-query by primary key. No writes, joins, or cross-shard queries. The workload that each shard receives is isolated, in that there are no single queries that span multiple shards.

Our target was to sustain 200k QPS on each shard, and then grow the cluster to increase throughput. Five shards, then fifty, then 512.

ShardsRoutersDelivered QPSQPS per shard
512999,624199,925
50489,923,900198,478
512480118,538,803231,521

Ten times the shards, ten times the throughput. Then ten times again. From 5 shards to 50 the per-shard rate held within 0.8%. At 512 the shards still had headroom, so we let the load generator use it and each shard settled at 231k QPS instead of 200k.

We sustained 118,538,803 QPS for 16 minutes across 512 shards and 1.22 PiB of data. Our largest recording was 118,747,267.

  • 512 shards, each with one Postgres primary each on an r8g.16xlarge
  • 480 Neki routers, each on its own 8xlarge instance
  • p99 latency of 6.06ms at the router and 13.95ms at the client
  • 67 errors per second, about one query in 1.8 million
  • 15.8M read IOPS across the fleet
  • over 2 Tb per second on the network

Worth being clear about this run: the shards were primary-only with no replicas, the workload is read-only across queries ranging in complexity, and we did not fail over during the measured window.

We will go into details on the engineering effort and interesting challenges we faced along the way to reaching 100 million QPS in a future article.

联系我们 contact @ memedata.com