tomcat - 设置最大文件数

标签 tomcat ubuntu ulimit

我试图在 etc/security/limits.conf 中设置 Ubuntu 中打开文件的最大数量的值,但是当我触发命令 时,我没有得到相同的值>ulimit -a。 我在 limits.conf 中添加以下值:

*          soft     nproc          65535
*          hard     nproc          65535
*          soft     nofile         65535
*          hard     nofile         65535

但是在触发 ulimit -a 时,我得到:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
max nice                        (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 139264
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 30048
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
max rt priority                 (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 139264
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

最佳答案

如果您的服务由 systemd 管理,那么您需要使用以下内容更新您的服务文件

LimitNOFILE=32768

例如tomcat.服务

关于tomcat - 设置最大文件数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22961087/

相关文章:

java - Spring Boot 在外部 tomcat 部署时抛出 NoSuchMethodError org.springframework.util.StringUtils.isEmpty

java.lang.NullPointerException : inStream parameter is null while loading a properties file

c - 使用 system() 函数运行 ulimit -d

c - 如何在 Mac OS X 上使用 ulimit 或每个进程为 C 或 Ruby 程序更改堆栈大小?

在 Ubuntu 中自动安装 OpenJDK 和 Apache Tomcat 的 Shellcript

Eclipse - 如何将 Kotlin 添加到 Tomcat 项目 - 编译 Kotlin 和 Java 文件

bash - 如何在 Ubuntu 上使用 bash 脚本读取 txt 文档中的值?

linux - ubuntu 上的 docker 登录超时 `Error calling StartServiceByName for org.freedesktop.secrets: Timeout was reached`

ubuntu - "Repository does not have a release file"错误

ubuntu - 限制进程在其生命周期内可以打开的文件描述符的数量