Increase the open file limit

Any questions about the Command Line Interface can be placed here!
Forum rules
Please note the disclaimer before modifying your Synology Product.

Increase the open file limit

Postby resurectin » Mon Jan 16, 2012 12:08 pm

Hello all,

I have installed on my NAS (DS411+) an indexer for searching files within the NAS.

The program is correctly installed and seems to work fine but after some time (while indexing) the program stop working correctly and log an exception "too many open files".
This error is fairly "normal" considering the current limit (1024 per user) and the "nature" of this program.

I though of raising this limit but so far no "luck" with regular methods.

I raised the over-all system limit using the sysctl config file. But then I tried to raise the limit of each users. Almost every information on internet say to edit the file "limits.conf" inside "/etc" or "/etc/security" but this file doesn't exist on the NAS.

How can I upgrade the limit of open file for a certain user on a synology NAS ? (or for all).

>> Try to edit the "/etc/profile" file by putting "ulimit -n xxxx" but I'm not really sure it is working for background processes.

Any help would be greatly appreciated.

regards,
mathieu
resurectin
I'm New!
I'm New!
 
Posts: 5
Joined: Mon Jan 09, 2012 1:59 pm

Re: Increase the open file limit

Postby maxxfi » Tue Jan 17, 2012 7:48 am

Try to add to /etc/sysctl.conf the value "fs.file-max = <number>" and reboot
DS-411 (DSM 4.2-3202) w/ 2x WD10EFRX + 1x HD154UI
DS-106j (DSM 3.0-1357), PATA-to-SATA adapter, 2.5" HM250HI
User avatar
maxxfi
Architect
Architect
 
Posts: 4334
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: Increase the open file limit

Postby resurectin » Tue Jan 17, 2012 11:52 am

Hi maxxfi,

I thank you for your response and appreciate your help.

I have added this parameter (with an arbitrary value. It is roughlty twice bigger than the previous value).
"sysctl.conf" file content :
Code: Select all
kernel.panic=3
fs.file-max = 231072

Then I have "commit" the change with the command "sysctl -p" but since then the NAS was also reboot.

After this change, the problem with the indexer was still there which led me to think that the background process is still limited by the user limit.
Unfortunately, I couldn't find how to inscrease this limit per user.

regards,
mathieu
resurectin
I'm New!
I'm New!
 
Posts: 5
Joined: Mon Jan 09, 2012 1:59 pm

Re: Increase the open file limit

Postby maxxfi » Tue Jan 17, 2012 12:52 pm

If you login as root, what do you see as limit?
DS-411 (DSM 4.2-3202) w/ 2x WD10EFRX + 1x HD154UI
DS-106j (DSM 3.0-1357), PATA-to-SATA adapter, 2.5" HM250HI
User avatar
maxxfi
Architect
Architect
 
Posts: 4334
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: Increase the open file limit

Postby resurectin » Tue Jan 17, 2012 1:19 pm

Hi,

Code: Select all
ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kb)             unlimited
stack(kb)            8192
coredump(blocks)     unlimited
memory(kb)           unlimited
locked memory(kb)    64
process              7919
nofiles              65000
vmemory(kb)          unlimited
locks                unlimited

65000 is the value I have set by adding "ulimit -n 65000" to the file "/etc/profile" but I'm not confident that this limit is used for background processes as it is loaded only when I'm logged in (ssh).
Without this line added to "/etc/profile" then the limit is 1024.

Also :
Code: Select all
sysctl -a | grep file
fs.file-nr = 960        0       231072
fs.file-max = 231072


regards,
mathieu
resurectin
I'm New!
I'm New!
 
Posts: 5
Joined: Mon Jan 09, 2012 1:59 pm

Re: Increase the open file limit

Postby resurectin » Tue Jan 17, 2012 4:15 pm

Hi,

I have observed two things today :
- When I stay logged in with an ssh session during the indexation > there is no particular problem (the limit of 65000 seems OK).
- When I logged off during the indexation > then the error appear after a while.

I tried to make a small sh specifying "ulimit -n 65000" in it before starting the indexer and it worked even after I logged off.
Honestly I don't understand exactly why, in this case the limit is OK, but at least it is working so my problem is "solved".

Thx,
mathieu
resurectin
I'm New!
I'm New!
 
Posts: 5
Joined: Mon Jan 09, 2012 1:59 pm


Return to Command Line Interface

Who is online

Users browsing this forum: No registered users and 1 guest