【发布时间】:2026-01-15 01:00:01
【问题描述】:
select 系统调用存在限制,超过 1024 后将无法工作。这是文档所说的
WARNING: select() can monitor only file descriptors numbers that
are less than FD_SETSIZE (1024)—an unreasonably low limit for
many modern applications—and this limitation will not change.
All modern applications should instead use poll(2) or epoll(7),
which do not suffer this limitation.
我们仅在 AWS EC2 实例中遇到过这种行为。 AWS fd 之外总是
Linux系统(Suse Linux 15 SP2)中是否有设置总是会创建fds
【问题讨论】:
-
我不这么认为,您是否考虑过使用
poll作为警告提示?另外,为什么要使用 AWS 标签? -
谢谢,我知道民意调查是另一种选择。是的,我们仅在 AWS EC2 实例中遇到过这种行为。 AWS fd 之外总是
-
是的,我们只在 AWS EC2 实例中遇到过这种行为。在 AWS fd 之外总是您可以将其添加到问题中。
-
你怎么能强迫它?如果低 ID 已经被占用了怎么办?你能做的最好的就是在你的程序中比较它,如果它更高就失败。
标签: c linux amazon-web-services amazon-ec2 suse