Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Got Too many open files in solr indexing through jenkins.

Did some googling and found we have to set the ulimit for the box in where we are running the job.

So set the ulimit in a linux box with spec

Linux x86_64 GNU/Linux

in both of the following fashions

  1. ulimit -n 1000000

  2. /etc/security/limits.conf

    userx soft nofile 1000000
    userx hard nofile 1000000


  1. userx is the user through which the jenkins job is being executed.
  2. when doing ssh to the box as userx manually through terminal and check ulimit -n am getting 10000000


But when executing the same ulimit -n through a jenkins job, only getting 1024 which is the default.

Any advice would be much helpful?

share|improve this question
check the init scripts for Jenkins to ensure they're not resetting the ulimit. Also, ensure Jenkins has been restarted since making the changes to limits.conf – Alastair McCormack Oct 8 '12 at 20:42

Make sure is enabled for su if your jenkins startup script is using "su" for user switching.

For Ubuntu Server, uncomment "session required" line in /etc/pam.d/su file

sudo sed -i '/# session\s\+required\s\ s/# *//' /etc/pam.d/su
share|improve this answer
Thanks @FlareCoder, my problem was bit amateur, please see my own answer. This will be definitely helpful for someone. – raksja Nov 14 '12 at 22:37
up vote 1 down vote accepted

By default Jenkins establish a SSH connection with each of the Node/Slave as userx.

I set the ulimit, took the node offline and bring it back and I thought the problem is on the session side.

So Disconnected the whole node from the jenkins and restarted the connection with it again. It brought back a new session for userx and it obviously worked.

My bad that I didn't look through the logs when I took the node offline.

Remember: Taking a jenkins node offline and bringing it back won't bring up a new SSH session.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.