Supervisord and ulimit to java app

Deadly 提交于 2019-12-22 11:17:23

问题


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

But my command cat /proc/4171/limits keeps saying:

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


回答1:


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

Remember to restart the supervisord after configuration change.




回答2:


I got the solutions writing another java program Test with the supervisor. I also used #!/bin/bash instead of #!/bin/sh and my linux user was not configured properly.

I also used this answer from serverfault to help me.



来源:https://stackoverflow.com/questions/27806286/supervisord-and-ulimit-to-java-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!