Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set ulimit on Confluence setenv.sh

Tova Pozen December 3, 2017

After a failed space XML import, I want to increase the open file descriptors limit of the Confluence user, as suggested on this Atlassian KB:

https://confluence.atlassian.com/confkb/xml-import-failed-with-too-many-open-files-error-200704392.html

and on this:

https://confluence.atlassian.com/confkb/health-check-confluence-open-files-limit-844236751.html

 

However, there are no instructions where exactly to insert the value - "ulimit -n 10000" -  in the file.

Can anyone tell me how it should be done?

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2017

Anywhere you know the line will be executed. 

setenv.sh is a script that varies by install and settings by site, so they can't just give you a  copy, they are relying on you having a basic understanding of scripts

Most simple place - insert it into the first empty lines at the top of the file.

Tova Pozen December 3, 2017

I've already tried just inserting it in the first empty line, but it didn't work out. That's why I thought it has to be inserted in a specific way.

I tried it again now , and this time, on restarting the service, noticed this message:

"/opt/atlassian/confluence/bin/setenv.sh: line 2: ulimit: open files: cannot modify limit: Operation not permitted"

I searched this message, and it figures I have to set the limit for confluence user also on /etc/security/limits.conf .

I might've tried it before, unless it's said everywhere those settings (on /etc/security/limits.conf) are not for system services. (is that related to the service process gets its limit from its parent process?)

Anyway - thanks - you helped me solve the issue.

Lars Olav Velle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2017

It relates to the user the process is running as.

If your application is running as the user "atlassian", then you need to add "atlassian" to /etc/security/limits.conf

Vlad June 13, 2018

Hi @Lars Olav Velle any restarts needed after the changes of /etc/security/limits.conf ?

 

Thanks in advance!

Deleted user January 29, 2019

@Lars Olav Velle @Vlad can you provide an example of the format used in `/etc/security/limits.conf`? It appears you need to specifc a username, maybe an @ sign before it, a type soft/hard and an item plus a value. My guess is something like this:

`atlassian    hard    ulimit    10000`

If you wanted the `atlassian` user to set ulimit to `10000`

Kaspars Laizans December 16, 2020

Limits.conf format:

atlassian hard nofile 10000

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events