2

I'm working on Ubuntu 16.04 with wildfly. I got an error "Caused by: java.net.SocketException: Too many open files". So I changed the ulimit to ulimited for all users.

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

in /etc/security/limits.conf

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

The problem is that another java process are got a new open files value(65535) except wildfly

 cat /proc/1717/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             128429               128429               processes
Max open files            4096                 4096                 files
Max locked memory         16777216             16777216             bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       128429               128429               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

I already restart the server. Please advise me how to fix this issue

Tien Dung Tran
  • 1,127
  • 4
  • 16
  • 32
  • do you control the application? it should stop opening so many god damn files. I dont think you can tell the OS to stop complaining about open files – JSelser Jan 31 '19 at 03:28
  • Searching about this error, people suggest increase ulimit can fix. Honestly, I don't know how to let this app stop opening so many files. – Tien Dung Tran Jan 31 '19 at 03:46
  • Have you tried https://stackoverflow.com/questions/5656458/java-net-socketexception-too-many-open-files/37605213#37605213. – Atul Feb 06 '19 at 22:41

1 Answers1

0

Max process for JBoss ulimit can be set according to the daily load received in server, but standard size is 65536, and openfiles also can be set more than 65536. We performed loadtest with concurrent users and max hits per sec to conclude on numbers.

Check JBoss ulimit:

jboss@user1>ulimit -aS ---> soft limit
jboss@user1>ulimit -aH ---> hard limit
TT.
  • 15,774
  • 6
  • 47
  • 88
Suresh Raja
  • 31
  • 2
  • 12