Skip to content

Commit aa2d2df

Browse files
authored
more info about io_uring and io_workers (#150)
Signed-off-by: usamoi <usamoi@outlook.com>
1 parent 16278a5 commit aa2d2df

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
fail: true
2828
format: markdown
2929
jobSummary: true
30-
lycheeVersion: nightly
30+
lycheeVersion: v0.20.1

src/vectorchord/usage/postgresql-tuning.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,27 @@ This section applies only to PostgreSQL 18.
5757

5858
### `io_uring`
5959

60-
`io_uring` method uses Linux's `io_uring`, which can reduce the overhead of context switches. This interface is available in kernel 5.1 and later. If you are using a newer kernel, it is recommended. You can enable this method through the GUC `io_method`.
60+
`io_uring` method uses Linux's `io_uring`, which can reduce the overhead of context switches. This interface is available in kernel 5.1 and later. You can enable this method through the GUC `io_method`.
6161

6262
```sql
6363
-- Note: A restart is required for this setting to take effect.
6464
ALTER SYSTEM SET io_method = 'io_uring';
6565
```
6666

67-
Because `io_uring` uses additional file descriptors, PostgreSQL may reach `RLIMIT_NOFILE` limit. You may need to increase this limit on your system.
67+
Since `io_uring` uses additional file descriptors and locked memory, PostgreSQL may reach `RLIMIT_NOFILE` and `RLIMIT_MEMLOCK` limits. You may need to increase these limits on your system. See also
6868

69-
For security reasons, container runtimes, cloud providers, and system administrators may disable `io_uring`. If this happens, check with your vendor for details. See also [Consider removing io_uring syscalls in from RuntimeDefault](https://github.com/containerd/containerd/issues/9048).
69+
* [limits.conf (PAM)](https://www.man7.org/linux/man-pages/man5/limits.conf.5.html)
70+
* [Process Properties (systemd)](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#Process%20Properties)
71+
* [Set ulimits in container (Docker)](https://docs.docker.com/reference/cli/docker/container/run/#ulimit)
72+
73+
For security reasons, container runtimes, cloud providers, and system administrators may disable `io_uring`. If this happens, check with your vendor for details. See also
74+
75+
* [Consider removing io_uring syscalls in from RuntimeDefault (containerd)](https://github.com/containerd/containerd/issues/9048)
76+
77+
`io_uring` is often considered recommended. However, performance depends on your workload. See also
78+
79+
* [Tuning AIO in PostgreSQL 18 (Tomas Vondra)](https://vondra.me/posts/tuning-aio-in-postgresql-18/)
80+
* [Benchmarking Postgres 17 vs 18 (planetscale)](https://planetscale.com/blog/benchmarking-postgres-17-vs-18)
7081

7182
This section applies only to Linux.
7283

@@ -79,8 +90,9 @@ This is the default in PostgreSQL 18. PostgreSQL avoids blocking backend by send
7990
ALTER SYSTEM SET io_method = 'worker';
8091

8192
-- Selects the number of I/O worker processes to use.
82-
-- It's recommended to set it to your parallelism.
93+
-- It's recommended to set it to the minimum of your parallelism and maximum value.
8394
-- For example, if your parallelism is 16, set the value to 16.
95+
-- The maximum value is 32, so you can't set it to anything higher.
8496
-- Note: A restart is required for this setting to take effect.
8597
ALTER SYSTEM SET io_workers = 16;
8698
```

0 commit comments

Comments
 (0)