HackerTrans
TopNewTrendsCommentsPastAskShowJobs

eivanov89

no profile record

Submissions

An efficient TPC-C benchmark for PostgreSQL based on C++ coroutines

github.com
1 points·by eivanov89·3 เดือนที่ผ่านมา·1 comments

[untitled]

1 points·by eivanov89·6 เดือนที่ผ่านมา·0 comments

Sharded Is Not Distributed: What You Should Know When PostgreSQL Is Not Enough

medium.com
1 points·by eivanov89·11 เดือนที่ผ่านมา·0 comments

The Surprising gRPC Client Bottleneck in Low-Latency Networks

blog.ydb.tech
76 points·by eivanov89·12 เดือนที่ผ่านมา·21 comments

Sharded Is Not Distributed: What You Should Know When PostgreSQL Is Not Enough

blog.ydb.tech
3 points·by eivanov89·ปีที่แล้ว·0 comments

[untitled]

1 points·by eivanov89·2 ปีที่แล้ว·0 comments

Weak isolation levels allowed to steal BTC using plain SQL

blog.ydb.tech
15 points·by eivanov89·2 ปีที่แล้ว·5 comments

An empirical answer to the question, when Postgres is not enough

blog.ydb.tech
21 points·by eivanov89·2 ปีที่แล้ว·3 comments

When Postgres is not enough: PostgreSQL vs. Distributed DBMSs

blog.ydb.tech
8 points·by eivanov89·2 ปีที่แล้ว·1 comments

We switched to Java 21 virtual threads and got a deadlock in Postgres TPC-C

blog.ydb.tech
17 points·by eivanov89·3 ปีที่แล้ว·0 comments

comments

eivanov89
·3 เดือนที่ผ่านมา·discuss
Dear friends, I'm the author of this implementation. Happy to discuss details.
eivanov89
·4 เดือนที่ผ่านมา·discuss
> Provocative thought in that case would then be - in what % are io_uring improvements (over libaio) undermined by the device behavior (firmware) in mixed workloads. That % could range from noticeably to almost nothing so it might very well affect the experiment conclusion.

That’s absolutely fair. Also, it would be useful to test across different devices, since their behavior can vary significantly, especially when preconditioned or under corner-case workloads.

In our case, we focused on scenarios typical for YDB deployments, so we didn’t extend the study further. That said, we believe the observed trends are fairly general.

> For example, if one is posing the question if switching to io_uring is worth it, I could definitely see different outcomes of that experiment in mixed workloads per observations that you described.

I agree that for mixed workloads the outcome may differ. However, for us the primary concern in the AIO vs io_uring comparison is syscall behavior.

It is critical that submission does not block unpredictably. Even without polling, io_uring shows consistently better latency across the full range of iodepths. If device latency dominates (as in your scenario), the relative benefit may shrink, but a faster submission path still helps drive higher effective queue depth and utilize the device better.

> This is also interesting. May I ask why is that the case? Are you able to saturate the NVMe disk just with a single thread? I assume not but you may be using some particular workloads and/or avoiding kernel that makes this possible.

The component we are working on is designed for write-intensive workloads. Due to DWPD constraints, we intentionally limit sustained write throughput to what the device can safely handle over its lifetime. In practice, this is often on the order of ~200–300 MB/s, which a single thread can easily saturate.

At the same time, we care a lot about burst behavior. With AIO, we observed poor predictability: total latency depends heavily on how requests are submitted (especially with batching), and syscall time can grow proportionally to batch size * event count.

io_uring largely eliminates this issue by decoupling submission from syscalls and providing a much more stable submission path. Additionally, for bursty workloads we can use SQPOLL + IOPOLL to further reduce latency in specialized setups.
eivanov89
·4 เดือนที่ผ่านมา·discuss
When IOMMU is not enabled, any PCIe device capable of DMA could access arbitrary physical memory. It allows to read any sensitive data, modifying memory and fully compromising the system without CPU involvement.

There are many DMA-based attacks described in the literature. Even with IOMMU, some attacks are still possible due to misconfiguration or incomplete isolation. For example: https://www.repository.cam.ac.uk/items/13dcaac4-5a3d-4f67-82...

In our case, we didn’t dive deeply into the security aspects. Our typical deployment assumes a trusted environment where YDB runs on dedicated hardware, so performance considerations tend to dominate.
eivanov89
·4 เดือนที่ผ่านมา·discuss
We compared IOMMU fully disabled vs enabled. When it is enabled, I expect it to be lazy (should be the default for IOMMU). Note, that we recommend to use passthrough to completely bypass translation for most devices independent on strict/lazy mode.
eivanov89
·4 เดือนที่ผ่านมา·discuss
There are a couple of challenges with mixed read+write workloads on NVMe.

In practice, read latency tends to degrade over time under mixed load. We observe this even across relatively short consecutive runs. To get meaningful results, you need to first drive the device into a steady state. In our case, however, we were primarily interested in software overhead rather than device behavior.

For a cleaner comparison, it would probably make sense to use something like an in-memory block device (e.g., ublk), but we didn’t dig into it.

As for profiling: we didn’t run perf, so the following is my educated guess:

1. With libaio, control structures are copied as part of submission/completion. io_uring avoids some of this overhead via shared rings and pre-registered resources. 2. In our experience (in YDB), AIO syscall latency tends to be less predictable, even when well-tuned. 3. Although we report throughput, the setup is effectively latency-bound (single fio job). With more concurrency, libaio might catch up.

We intentionally used a single job because we typically aim for one thread per disk (two at most if polling enabled). In our setup (usually 6 disks), increasing concurrency per device is not desirable.
eivanov89
·4 เดือนที่ผ่านมา·discuss
That's super hot. Especially the update with the 37M IOPS reference. Might be very useful for my next tasks related to a setup with 6 NVMe disks: 1. Get all disks saturated through the network (including RDMA usage). 2. Play with io_uring to share a polling thread. Currently, no luck: if I share kernel poller between two devices then improvement is just +30% (at a cost of 1 core). Considering alternative schemes now.
eivanov89
·4 เดือนที่ผ่านมา·discuss
BTW, the whole situation with IRQ accounting disabled reminds me the -fomit-frame-pointer case. For a long time there was no practical performance reason, but the option had been used... Making slower and harder to build stacks both for perf analyses and for stack unwinding in languages like C++.

After careful reading I'm surprised how small IRQ squares build up 30%. Should search for interrupts when I inspect our flamegraphs next time.
eivanov89
·4 เดือนที่ผ่านมา·discuss
Unfortunately, we don't have a proper measurements for IOPOLL mode with and without IOMMU, because initially we didn't configure IOPOLL properly. However, I bet that this mode will be affected as well, because disk still has to write using IOMMU.

You suggest a very interesting measurements. I will keep it in my mind and try during next experiments. Wish I have read this before to apply during the past runs :)
eivanov89
·4 เดือนที่ผ่านมา·discuss
That's a popular DBMS pattern. We chosen writes over reads, because on many NVMe devices writes are faster and it is easier to measure software latency.

I guess that in case of sequential I/O result would be similar. However with larger blocks and less IOPS the difference might be smaller.
eivanov89
·4 เดือนที่ผ่านมา·discuss
Dear folks, I'm the author of that post.

A short summary below.

We ran fio benchmarks comparing libaio and io_uring across kernels (5.4 -> 7.0-rc3). The most surprising part wasn’t io_uring gains (~2x), but a ~30% regression caused by IOMMU being enabled by default between releases.

Happy to share more details about setup or reproduce results.
eivanov89
·12 เดือนที่ผ่านมา·discuss
That's indeed interesting, thank you for sharing.
eivanov89
·ปีที่แล้ว·discuss
To the extent of my knowledge, only forks like YugabyteDB make PostgreSQL truly distributed. Or you should switch to another DB.
eivanov89
·ปีที่แล้ว·discuss
Dear friends, I’m the author of this post and I’d love to hear your thoughts and discuss it here.
eivanov89
·2 ปีที่แล้ว·discuss
My post is a secondary research regarding potential issues with weak isolation levels. It includes a link [0] to an in-depth description of what happened to Flexcoin. Additionally, the post references another similar BTC attack [1] that exploited a "lost update" due to weak isolation levels.

The goal of the post is to highlight this problem, as cited research papers clearly demonstrate that such issues occur more frequently than commonly perceived.

Again, I'm sorry that the title might be misleading and you have expected a different content.

[0] https://hackingdistributed.com/2014/04/06/another-one-bites-...

[1] https://www.reddit.com/r/Bitcoin/comments/1wtbiu/how_i_stole...
eivanov89
·2 ปีที่แล้ว·discuss
Sorry, might be that the title is a little bit inaccurate. However, the post indeed describes multiple cases, when attackers have stolen many BTC from the exchanges, because of the issue with a weak isolation level. Moreover, one of the exchanges was totally ruined because of that.
eivanov89
·2 ปีที่แล้ว·discuss
Hi there, I'm the author of the post. I'm happy to answer any questions and appreciate any feedback and experience shared.
eivanov89
·2 ปีที่แล้ว·discuss
I think Denis addressed this in his post: "Overall, as an engineer, you will never regret taking part in the development of a sharding solution. It’s a complex engineering problem with many non-trivial tasks to solve". In other words, it might be not invented here syndrome (with all due respect to Figma team). Or there might be more nuances we are unaware about.
eivanov89
·2 ปีที่แล้ว·discuss
In YDB with block 4+2 erasure coding, you need half the disk space compared to mirror-3-dc schema. Meanwhile CPU usage is just a little bit higher, thus in high throughput tests mirror-3-dc wins. Indeed as mentioned in the post there might be a tail latency win in latency runs, but if your task is throughput with a reasonable latencies, replication might be a better choice.
eivanov89
·2 ปีที่แล้ว·discuss
We plan, but currently we are blocked by this issue: https://github.com/yugabyte/tpcc/issues/147 Thus, we consider either waiting for the improvement or trying running DBMSs in containers.
eivanov89
·2 ปีที่แล้ว·discuss
Absolutely. Both CockroachDB and YDB have replication factor equal to 3. So it's similar to Postgres with 2 sync replicas.