Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Tell us about your request
An opt-in way to allow the io_uring syscalls (io_uring_setup, io_uring_enter,
io_uring_register) for ECS tasks on Fargate, off by default. For example, a
container definition setting such as linuxParameters.allowIoUring: true
(name illustrative).
Which service(s) is this request for?
ECS on Fargate
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
I want to run high-performance, I/O-heavy workloads on Fargate. io_uring can
reduce syscall overhead and improve throughput and latency for these
workloads, especially storage-heavy ones (databases, storage engines,
log/queue systems), and a growing set of runtimes and libraries build on it
(for example tokio-uring, monoio and glommio in Rust). Today these
workloads cannot use io_uring on Fargate at all, so teams that need it must
choose between giving up Fargate and giving up io_uring.
io_uring is blocked inside Fargate tasks, and no task definition setting can
change that: dockerSecurityOptions, privileged and custom seccomp profiles
are not available on Fargate.
I tested this with a small probe (Rust, io-uring crate) running as a
non-root, unprivileged task on platform 1.4.0 (kernel 6.1.189, eu-west-1),
with identical results in two runs on different hosts. The probe checks
availability, not performance:
- The kernel has io_uring compiled in (
/proc/kallsyms), and
kernel.io_uring_disabled is not present.
- All three io_uring syscalls fail with
EPERM, even when called with
arguments the kernel would reject with EBADF/EINVAL. So they are rejected
before the kernel handles them, consistent with the seccomp filter
(Seccomp: 2, one filter active).
- The same image on ECS on EC2 (ECS-optimized AL2023 AMI, kernel 6.1.190)
gives the same result with Docker's default seccomp profile. Adding only
those three syscalls to that profile makes every io_uring test pass, still
unprivileged and non-root.
Code, CloudFormation templates, raw results and analysis:
https://github.com/lmammino/aws-fargate-test-iouring
(see docs/RESULTS.md).
Are you currently working around this issue?
ECS on EC2 with a custom Docker daemon seccomp profile (seccomp-profile in
daemon.json), tested in the repository above. ECS has no per-container
seccomp setting even on EC2, so this applies to every container on the
instance: it needs dedicated instances and gives up Fargate's operational
model. privileged: true would also work on EC2, but grants far more than
io_uring needs. Otherwise, falling back to epoll-based I/O, which gives up the
benefit entirely.
Additional context
I understand why io_uring was removed from the Docker/containerd default
profiles (moby/moby#46762, containerd/containerd#9320) because of its kernel
attack surface. That is why I suggest an explicit opt-in, scoped to the
containers that need it, rather than changing the default. Enabling it stays
a deliberate, auditable customer choice.
Related: #1782 (custom seccomp profiles for ECS), #1957 (custom seccomp
profile on Fargate), #356 (seccomp=unconfined).
Attachments
N/A