Friday, May 18, 2012

JBoss - Too many open files

Issue: I faced this issue in JBoss while doing load testing. Under heavy load, jboss http connector crashed and it refused to accept any new connections. On checking logs, I found out that the root cause was “Too many open files” issue.


Resolution: “Too many open files” – this issue is a linux issue. OS enforces a limit on each process for maximum number of files that can get attached to a process. Normally the default value is 1024. (Default value can be checked using this command: “ulimit -n“) This value is not sufficient for processes like application containers.


All the files associated with given process can be seen with this command: lsof -p <pid>


More details about how can this value be changed is available on this wonderful blog post -


One thing missing in this blog is that for ‘root’ user, you have to specifically mention the user name while modifying /etc/security/limits.conf file. Wild cards are not applicable for root user.

For example, following lines should be enter in /etc/security/limits.conf file for root user –


root            soft      nofile        4096

root            hard    nofile        8192





Friday, May 4, 2012

JBoss TimerService - bug fix

As such the TimerService implementation is not stable in jboss6.1.
The version of timer-service library (of JBoss6.1.0.Final) itself says it is only an ALPHA lib… not a GA (jboss-ejb3-timerservice-mk2.jar, version 1.0.0-alpha-13)

I was facing an issue with the TimerService and while looking for a solution, found out JBoss team doesn’t support issues of JBoss-6x any longer.
The issue was related to Transaction management in Timer Service implementation.

Following is the JIRA defect and attached is the library with fix of the issue.
You can get the source code also at my GitHub page mentioned below.

Fixed lib jar file –