问题描述
我正在使用supervisord来启动我的Java应用程序。应用程序工作正常,但我的ulimit nofiles没有设置。我可以使用debian在一台机器上完成。但是在第二台机器上存在此配置无效的问题。基本上,我用脚本启动我的应用程序:
I am using supervisord to start my java app. The application is working OK, but my ulimit nofiles is not set. I could do it in one machine, using debian. but there is a problem on the second machine that this configuration is not working. Basically, I start my app with a script:
#!/bin/sh
iscsiJar="/mnt/cache/jscsi/udrive.jar"
ulimit -SHn 32768
# função para iniciar a aplicação
java -XX:MaxHeapFreeRatio=70 -Xmx2048M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -jar $iscsiJar
但我的命令cat / proc / 4171 / limits一直说:
But my command cat /proc/4171/limits keeps saying:
最大打开文件4096 4096个文件
Max open files 4096 4096 files
任何提示?我已经在互联网上到处搜索....我可以在这个问题上尝试这种方式>
Any hint? I already search everywhere at internet.... I could try this way on this question> nohup create new files nohup.out by day
推荐答案
如果有人还在寻找解决方案为此,请尝试在supervisord配置文件中设置: minfds 参数:
In case someone is still looking for a solution for that, try setting: minfds parameter within supervisord configuration file:http://supervisord.org/configuration.html#supervisord-section-values
请记住在配置更改后重新启动supervisord。
Remember to restart the supervisord after configuration change.
这篇关于Supervisord和ulimit到java应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!