Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
11–20 of 95 posts
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#12Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#13Hey HN, I built this. Honker adds cross-process NOTIFY/LISTEN to SQLite. You get push-style event delivery with single-digit millisecond latency without a damon/broker, using your existing SQLite file. A lot of pretty high-traffic applications are just Framework+SQLite+Litestream on a VPS now, so I wanted to bring a sixer to the "just use SQLite" party. SQLite doesn't run a server like Postgres, so the trick is movin…
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#14Hey HN, I built this. Honker adds cross-process NOTIFY/LISTEN to SQLite. You get push-style event delivery with single-digit millisecond latency without a damon/broker, using your existing SQLite file. A lot of pretty high-traffic applications are just Framework+SQLite+Litestream on a VPS now, so I wanted to bring a sixer to the "just use SQLite" party. SQLite doesn't run a server like Postgres, so the trick is movin…
Nice, I had no idea that stat() every 1 ms is so affordable. Aparently it takes less than 1 μs per call on my hardware, so that's less than 0.1% cpu time for polling.
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#15Wouldn't processes on same machine be able to use different IPCs that don't even touch file ? It's neat but I have feeling in vast majority of cases just passing address to one of the IPC methods would be faster and then SQLite itself would only be needed for the durable parts.
It is possible to achieve with external IPC, but require a lot of very careful programming.
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#16Earlier quoted context omitted.
Nice, I had no idea that stat() every 1 ms is so affordable. Aparently it takes less than 1 μs per call on my hardware, so that's less than 0.1% cpu time for polling.
"Syscalls are slow" is only mostly true. They are slower than not having to cross the userspace OS barrier at all, but they're not "slow" like cross-ocean network calls can be. For example, non-VDSO syscalls in linux are about 250 nanoseconds (see for example https://arkanis.de/weblog/2017-01-05-measurements-of-system-... ), VDSO syscalls are roughly 10x faster. Slower than userspace function calls for sure, but more…
But I agree with the conclusion, system calls are still pretty fast compared to a lot of other things.
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#17one thing i'm curious about: WAL checkpoint. when SQLite truncates WAL back to zero, does the stat() polling handle that correctly? feels like there's a window where events could get lost.
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#18I have a proliferation of small apps backed by SQLite. And most of these need a queue and scheduler.
I home rolled some stuff for it but was always pining for the elegance of the Postgres solutions.
Will give this a spin very soon
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#19Earlier quoted context omitted.
Nice, I had no idea that stat() every 1 ms is so affordable. Aparently it takes less than 1 μs per call on my hardware, so that's less than 0.1% cpu time for polling.
"Syscalls are slow" is only mostly true. They are slower than not having to cross the userspace OS barrier at all, but they're not "slow" like cross-ocean network calls can be. For example, non-VDSO syscalls in linux are about 250 nanoseconds (see for example https://arkanis.de/weblog/2017-01-05-measurements-of-system-... ), VDSO syscalls are roughly 10x faster. Slower than userspace function calls for sure, but more…
In other words, there’s a lot of unmeasured performance degradation that’s a side effect of doing many syscalls above and beyond the CPU time to enter/leave the kernel which itself has shrunk to be negligible. But there’s a reason high performance code is switching to io_uring to avoid that.
Re: Show HN: Honker – Postgres NOTIFY/LISTEN Semantics for SQLite
#20Earlier quoted context omitted.
"Syscalls are slow" is only mostly true. They are slower than not having to cross the userspace OS barrier at all, but they're not "slow" like cross-ocean network calls can be. For example, non-VDSO syscalls in linux are about 250 nanoseconds (see for example https://arkanis.de/weblog/2017-01-05-measurements-of-system-... ), VDSO syscalls are roughly 10x faster. Slower than userspace function calls for sure, but more…
That’s ignoring the other costs of syscalls like evicting your stuff from the CPU caches. But I agree with the conclusion, system calls are still pretty fast compared to a lot of other things.