118M Queries per Second on Neki

(planetscale.com)

29 points | by joshmgross 1 hour ago

7 comments

  • farazbabar 0 minutes ago
    In 2015, I was able to get to 1 million read/write queries per second on only a couple nodes and tested this with multiple databases, it required (at the time) decent network tuning and node placement inside AWS but it cost me about 10 to 15 dollars per run if I recall correctly, obviously there is the matter of scaling such performance and so I want to recognize the engineering effort gone into this but this is too much money. This reminds of when one of my teams used Hadoop to process only a a few terabytes of offline data and were able to process the WHOLE THING in only a few hours. I did not have the heart or courage to tell them during the demo that this was overkill, but I did write a very simple (and small) piece of code that could extract all the signals from the offline files in mere seconds with careful network planning and storage optimization and invited them for a demo/lunch and learn next week.
  • danbruc 16 minutes ago
    87.3 % served from cache. Does that mean it returned a result existing in the cache because the very same query was executed before? Probably still a relevant result, if you have to process millions of queries every second, it seems not unlikely that you will see a lot of repeated queries. But at that point you are measuring cache performance more than query performance. But unless you run some standardized query benchmark, a single queries per second number is not that informative anyway because query complexity and therefore execution time can span many others of magnitude. Looking up a name by ID and aggregating across a billion rows from seventeen tables joined together are both a single query.
  • samlambert 1 hour ago
    It cost $250,000 to do this run but it feels worth it.
    • jeffbee 33 minutes ago
      That's roughly 250x more than it would cost to perform this stunt using on-demand Cloud Bigtable, if my math checks out (~1150 nodes @ 85¢/hour for 1h).
    • handfuloflight 59 minutes ago
      I did not know men could build such things.
    • whalesalad 51 minutes ago
      I estimated the cluster to achieve this was ~$3-4k per-hour. I am thinking there is a typo on the r8g.16xlarge and they are actually r8gd.16xlarge (notice the d) which comes with directly attached nvme disks.
      • rcrowley 13 minutes ago
        It felt rude to take so many r8gd instances away from our customers who really love those (and i8g and i8ge).
      • svuiv 39 minutes ago
        We used r8g.16xlarge instances with EBS disks, no nvmes
        • whalesalad 7 minutes ago
          would love to hear more about the ebs volumes, iops/size/raid configuration
          • svuiv 4 minutes ago
            each shard had a 4TiB volume with 65k IOPS and 1,500 mbps of throughput
  • AdamProut 39 minutes ago
    I'm curious why the test needed so many router hosts:

    512 shards, each with one Postgres primary each on an r8g.16xlarge

    480 Neki routers, each on its own 8xlarge instance

    That's ~250K queries/sec per router which seems lowish for this type of workload? The routers won't be doing very much (parse query, route it to proper shard?).

    • svuiv 5 minutes ago
      that's over 13k queries/sec per router core, about 50% of it is spent doing syscalls, the other 50%: parsing, doing grpc, tls, go gc, resolving the shards, waiting for the responses

      neki is still in platform preview, this experimentation allowed us to collect profiles at such scale and ship some nice optimizations, more are coming

  • znpy 57 minutes ago
    If this is closed source then i have zero interest in it.
    • jjice 17 minutes ago
      I believe multigress is the similarly aged open equivalent from Supabase. Haven't used it myself and don't know what the differences are in usability, but I'm a bit more interested in that since it's open.
      • samlambert 5 minutes ago
        Neki right now:

        Multiple live shards: yes

        Query routing across shards: yes

        Online shard splitting: yes

        Zero-downtime resharding: yes

        Multiple independent shard groups: yes

        Data topology management: yes

        HA / automated failover: yes

        Multi-AZ: yes

        Connection pooling: yes

        Online schema changes: yes

        Workflow-driven migrations/cutovers: yes

        Zero-downtime imports: yes

        CDC / logical replication: yes

        Online Postgres version upgrade workflows: yes

        Cross-shard transactions: coming

        Multigres today:

        Multiple live shards: no

        Query routing across shards: no

        Online shard splitting: no

        Resharding: no

        Multiple shard groups: no

        HA / failover: yes

        Multi-AZ: yes

        Connection pooling: yes

        Logical replication/import work: in progress

        Distributed migration/resharding workflows: no

        How it is an it's an alternative? Do you just say things without validating?

      • spongeboi 10 minutes ago
        unfortunately they haven't been able to move forward w/ the project, it can't even shard yet
    • noir_lord 21 minutes ago
      Someone posted a twitch conversation yesterday about this, I poked around on the page realised there was no open source version and noped out immediately.

      I'm sure it's a great product (it seems like planetscale do good engineering and the folks I know who use them seem fine with it) but I don't do vendor lock-in as a service personally, I'll use whatever employer uses because that's the deal but for personal stuff, well this isn't designed for that really, wrong order of magnitude on scaling.

  • jeffbee 1 hour ago
    The fact that you can just pay to scale out point reads is not news to anyone.
    • AdamProut 41 minutes ago
      yeah, this is a definitely a "best case" workload for a sharded database. Single row reads on the key used to shard with no hotspots (no shard to shard network traffic at all).