【问题标题】:How to increase the open files user limit in boxfuse?如何增加 boxfuse 中打开文件的用户限制?
【发布时间】:2017-10-19 20:18:42
【问题描述】:

我收到“TooManyOpenFiles”异常。我已经添加了自定义src/main/resources/sysctl.conf

fs.file-max = 64000

但是UnixOperatingSystemMXBean#getMaxFileDescriptorCount() 仍然返回4096

我想我还必须设置用户限制 - 有没有办法在 boxfuse 中做到这一点?

【问题讨论】:

    标签: linux linux-kernel ulimit sysctl cloudcaptain


    【解决方案1】:

    Boxfuse 客户端 1.26.7.1312 及更高版本自动调整用户限制以匹配内核限制。见https://cloudcaptain.sh/docs/releasenotes#1.26.7.1312https://cloudcaptain.sh/docs/payloads/springboot#sysctl

    只需使用boxfuse -u 升级即可。

    【讨论】:

    • 我需要按照其他答案的建议进行操作,即更新 ulimit。那可能吗。我们可以增加limits 还是你知道值是多少?我们在Prod 上遇到了一个问题,基本上看起来像是缺少 FD 或某些限制阻止创建额外的套接字,即使实例没有被使用(连接速度慢)
    【解决方案2】:

    您也必须更改 ulimit 配置。

    # vim /etc/security/limits.conf
    

    更改或添加行

    *   hard    nofile  1048576
    *   soft    nofile  1048576
    

    您可以将特定的用户名或组以@(@group)作为前缀,而不是使用 *

    然后您将不得不重新启动系统以应用更改(或使用 ulimit 命令)

    【讨论】:

      猜你喜欢
      • 2022-01-25
      • 2016-06-24
      • 2014-02-26
      • 2020-12-11
      • 2015-06-03
      • 2011-03-11
      • 2016-01-19
      • 2020-04-18
      • 1970-01-01
      相关资源
      最近更新 更多