What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Increase open files limit

Max.Henri

New Around Here
Hello all,

I am pretty new to Linux, so I apologize if this is elementary :)
I would like to know if there is a way to increase open files limit for my processes on the Asuswrt Merlin firmware? I have a process which keeps crashing due to this. As far as I can see, it's limited to 1024.
 
Got it. ulimit -n 2048 to get it to 2048 instead of 1024. Now I just have to finde a place for it in my scripts :)
 
Guess I was too quick. Resets to 1024 once I close the terminal. All the conventional solutions like editing /etc/security/limits.conf or sysctl doesn't seem to be available, since those files aren't on the router.
 
That's why I said you have to put it in the startup script of your program (which you haven't specified, so I can't help you on that).

I am sorry I totally missed that. The program in question is NZBGet. Now I have used the entware package for it, instead of the official version, and gotten a startup script for it in init.d. I added ulimit -n 2048 and ulimit -s 2048 to the end of the script, and I have added to /jffs/scripts/post-mount
sleep 30
/opt/etc/init.d/rc.unslung restart

But the script didn't run when the router booted up, so I ran the /opt/etc/init.d/rc.unslung restart in ssh, but ulimit -a shows no changes still.
 
and gotten a startup script for it in init.d. I added ulimit -n 2048 and ulimit -s 2048 to the end of the script, and I have added to /jffs/scripts/post-mount
sleep 30
/opt/etc/init.d/rc.unslung restart

But the script didn't run when the router booted up, so I ran the /opt/etc/init.d/rc.unslung restart in ssh, but ulimit -a shows no changes still.
I don't use Entware so I can only offer guesses.

1) Typing "ulimit -a" will only show you the settings that apply to your current shell. It does not show you the values applied to other running processes or system-wide. So it might actually be working. Are you seeing any errors?

2) If the script isn't running at boot time then that's a problem.

2) Are you editing /opt/etc/init.d/S75nzbget? If so, "ulimit -n 2048" should be before the line that says ". /opt/etc/init.d/rc.func", not after.
 
Last edited:
Yea the script isn't running at boot. The daemon doesn't start, and I checked the /proc/<pid>/limits, and it's still 1024 for the process. I did set the ulimit -n 2048 before ". /opt/etc/init.d/rc.func". But it appears the problem is fixed by running the entware package version of nzbget, instead of the latest version, so I can stick with that at least :)
 
OK Thanks for the update although I don't really follow what you've done :)

You say the daemon doesn't start, yet you're checking its /proc/<pid>/limits? You also said in post #6 that you're using the entware package of NZBGet but now you're saying you were running the non-entware version.:confused:

Never mind though, so long as it's working.:)

All the best.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top