Increasing open files limit for all processes: Do I need to set Soft/Hard limits?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to fix the following error that I get after a day or two of running my game server.
2017/12/13 12:08:35 http: Accept error: accept tcp [::]:8081: accept4: too many open files; retrying in 1s
I added "fs.file-max = 2000000" to /etc/sysctl.conf and executed
sysctl -w fs.file-max=2000000
sysctl -p
My global limits are now updated (do I need to reboot?) but the soft and hard limits are still 1024 and 4096 respectively.
Also when using the following command to check for "open files" for root user:
su - root -c 'ulimit -aHS' -s '/bin/bash'
I'm getting 1024 as well.
What does the soft and hard limit do and do I need to change them in order for the global limits to have any effect? And how about the user (root) limit?
Thanks!
linux centos limit ulimit resources
add a comment |Â
up vote
1
down vote
favorite
I'm trying to fix the following error that I get after a day or two of running my game server.
2017/12/13 12:08:35 http: Accept error: accept tcp [::]:8081: accept4: too many open files; retrying in 1s
I added "fs.file-max = 2000000" to /etc/sysctl.conf and executed
sysctl -w fs.file-max=2000000
sysctl -p
My global limits are now updated (do I need to reboot?) but the soft and hard limits are still 1024 and 4096 respectively.
Also when using the following command to check for "open files" for root user:
su - root -c 'ulimit -aHS' -s '/bin/bash'
I'm getting 1024 as well.
What does the soft and hard limit do and do I need to change them in order for the global limits to have any effect? And how about the user (root) limit?
Thanks!
linux centos limit ulimit resources
1
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to fix the following error that I get after a day or two of running my game server.
2017/12/13 12:08:35 http: Accept error: accept tcp [::]:8081: accept4: too many open files; retrying in 1s
I added "fs.file-max = 2000000" to /etc/sysctl.conf and executed
sysctl -w fs.file-max=2000000
sysctl -p
My global limits are now updated (do I need to reboot?) but the soft and hard limits are still 1024 and 4096 respectively.
Also when using the following command to check for "open files" for root user:
su - root -c 'ulimit -aHS' -s '/bin/bash'
I'm getting 1024 as well.
What does the soft and hard limit do and do I need to change them in order for the global limits to have any effect? And how about the user (root) limit?
Thanks!
linux centos limit ulimit resources
I'm trying to fix the following error that I get after a day or two of running my game server.
2017/12/13 12:08:35 http: Accept error: accept tcp [::]:8081: accept4: too many open files; retrying in 1s
I added "fs.file-max = 2000000" to /etc/sysctl.conf and executed
sysctl -w fs.file-max=2000000
sysctl -p
My global limits are now updated (do I need to reboot?) but the soft and hard limits are still 1024 and 4096 respectively.
Also when using the following command to check for "open files" for root user:
su - root -c 'ulimit -aHS' -s '/bin/bash'
I'm getting 1024 as well.
What does the soft and hard limit do and do I need to change them in order for the global limits to have any effect? And how about the user (root) limit?
Thanks!
linux centos limit ulimit resources
asked Dec 13 '17 at 15:44
SJ19
62
62
1
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03
add a comment |Â
1
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03
1
1
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
The limit you set with sysctl
is a system setting that applies to the whole system. It is not a limit that applies to individual processes.
Each process can have no more than N files open where N is the process's NOFILE
soft limit, and it can change its own soft limit to no more than the hard limit. Only processes running as root can raise their hard limit. Processes inherit their parent's limits.
The way to change the limit for a single service (which is what you should do) depends on your init system.
- For SysVinit (CentOS â¤6): edit the init script for the service (normally located in
/etc/rc.d/init.d
) to callulimit
before running the daemon, then restart the service. For Systemd (CentOS âÂÂ¥7): edit the service's unit file
/etc/systemd/system/my_game_server.service
and add a directiveLimitNOFILE=16384
Then run
systemctl daemon-reload
to reload the configuration, then restart your service.
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,limits.conf
is the configuration file ofpam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...
â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typingstart-stop-daemon â¦
or/etc/rc.d/â¦
in a shell.
â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
 |Â
show 2 more comments
up vote
1
down vote
You can change the limits in /etc/security/limits.conf
. Log out and in to take effect.
Hardlimit: The boundary for a certain user - can not be increaed by that user during runtime, only decreased: ulimit -Hu 2000
. List of Hardlimits: ulimit -Ha
Softlimit: A "soft" boundary within the hardlimit, can be changed by the user during runtime: ulimit -Su 10000
.List of Softlimits: ulimit -Sa
Change ulimits for a running process: prlimit -p $$ --nproc=1200:
. This will change the number of processes (softlimit) to 1200 for the current shell $$
.
add a comment |Â
up vote
0
down vote
You can change the number of limits in file /etc/security/limits.conf
(for particular user or for everyone)
You should add like this:
username soft nofile 4096
username hard nofile 5120
and this will set number of open files to 4096 (soft limit) and 5120 as top
After this edit you need to relogin and restrart the service(s) to get this in charge.
As far as I remember ulimit
will make changes only till you logout from this user
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I knowsysctl
will change the parameter in kernel, but if you have limit inlimits.conf
they will limit you
â Romeo Ninov
Dec 13 '17 at 16:01
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (LimitFiles
if I remember correctly.)
â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits forroot
user, logout, login again and run it
â Romeo Ninov
Dec 13 '17 at 16:22
 |Â
show 3 more comments
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The limit you set with sysctl
is a system setting that applies to the whole system. It is not a limit that applies to individual processes.
Each process can have no more than N files open where N is the process's NOFILE
soft limit, and it can change its own soft limit to no more than the hard limit. Only processes running as root can raise their hard limit. Processes inherit their parent's limits.
The way to change the limit for a single service (which is what you should do) depends on your init system.
- For SysVinit (CentOS â¤6): edit the init script for the service (normally located in
/etc/rc.d/init.d
) to callulimit
before running the daemon, then restart the service. For Systemd (CentOS âÂÂ¥7): edit the service's unit file
/etc/systemd/system/my_game_server.service
and add a directiveLimitNOFILE=16384
Then run
systemctl daemon-reload
to reload the configuration, then restart your service.
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,limits.conf
is the configuration file ofpam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...
â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typingstart-stop-daemon â¦
or/etc/rc.d/â¦
in a shell.
â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
 |Â
show 2 more comments
up vote
1
down vote
The limit you set with sysctl
is a system setting that applies to the whole system. It is not a limit that applies to individual processes.
Each process can have no more than N files open where N is the process's NOFILE
soft limit, and it can change its own soft limit to no more than the hard limit. Only processes running as root can raise their hard limit. Processes inherit their parent's limits.
The way to change the limit for a single service (which is what you should do) depends on your init system.
- For SysVinit (CentOS â¤6): edit the init script for the service (normally located in
/etc/rc.d/init.d
) to callulimit
before running the daemon, then restart the service. For Systemd (CentOS âÂÂ¥7): edit the service's unit file
/etc/systemd/system/my_game_server.service
and add a directiveLimitNOFILE=16384
Then run
systemctl daemon-reload
to reload the configuration, then restart your service.
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,limits.conf
is the configuration file ofpam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...
â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typingstart-stop-daemon â¦
or/etc/rc.d/â¦
in a shell.
â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
 |Â
show 2 more comments
up vote
1
down vote
up vote
1
down vote
The limit you set with sysctl
is a system setting that applies to the whole system. It is not a limit that applies to individual processes.
Each process can have no more than N files open where N is the process's NOFILE
soft limit, and it can change its own soft limit to no more than the hard limit. Only processes running as root can raise their hard limit. Processes inherit their parent's limits.
The way to change the limit for a single service (which is what you should do) depends on your init system.
- For SysVinit (CentOS â¤6): edit the init script for the service (normally located in
/etc/rc.d/init.d
) to callulimit
before running the daemon, then restart the service. For Systemd (CentOS âÂÂ¥7): edit the service's unit file
/etc/systemd/system/my_game_server.service
and add a directiveLimitNOFILE=16384
Then run
systemctl daemon-reload
to reload the configuration, then restart your service.
The limit you set with sysctl
is a system setting that applies to the whole system. It is not a limit that applies to individual processes.
Each process can have no more than N files open where N is the process's NOFILE
soft limit, and it can change its own soft limit to no more than the hard limit. Only processes running as root can raise their hard limit. Processes inherit their parent's limits.
The way to change the limit for a single service (which is what you should do) depends on your init system.
- For SysVinit (CentOS â¤6): edit the init script for the service (normally located in
/etc/rc.d/init.d
) to callulimit
before running the daemon, then restart the service. For Systemd (CentOS âÂÂ¥7): edit the service's unit file
/etc/systemd/system/my_game_server.service
and add a directiveLimitNOFILE=16384
Then run
systemctl daemon-reload
to reload the configuration, then restart your service.
answered Dec 13 '17 at 16:06
Gilles
507k12010031530
507k12010031530
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,limits.conf
is the configuration file ofpam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...
â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typingstart-stop-daemon â¦
or/etc/rc.d/â¦
in a shell.
â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
 |Â
show 2 more comments
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,limits.conf
is the configuration file ofpam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...
â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typingstart-stop-daemon â¦
or/etc/rc.d/â¦
in a shell.
â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
Thanks! I'm running my program in a screen on root user, CentOS7. Does that mean I don't have to change anything now?
â SJ19
Dec 13 '17 at 16:10
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@SJ19 You do need to change the service's unit file, unless you've changed the limits globally as in Romeo's answer.
â Gilles
Dec 13 '17 at 16:34
@Gilles, If I've understood correctly,
limits.conf
is the configuration file of pam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...â ilkkachu
Dec 13 '17 at 20:30
@Gilles, If I've understood correctly,
limits.conf
is the configuration file of pam_limits.so
. Does it apply to daemons started by init in any system (or any init, for that matter)? Though if SJ19 starts their daemon from an interactive session, then the limits of the session would be the ones that matter...â ilkkachu
Dec 13 '17 at 20:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typing
start-stop-daemon â¦
or /etc/rc.d/â¦
in a shell.â Gilles
Dec 14 '17 at 8:30
@ilkkachu It doesn't apply to daemons started by init at boot time. But under SysVinit it would indirectly apply to a daemon started by someone typing
start-stop-daemon â¦
or /etc/rc.d/â¦
in a shell.â Gilles
Dec 14 '17 at 8:30
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
@ilkkachu What exactly does "pam" and "daemon" mean? And why would I need to change those rather than the user limits? It just keeps getting more confusing to me... I appreciate the help though!
â SJ19
Dec 16 '17 at 11:14
 |Â
show 2 more comments
up vote
1
down vote
You can change the limits in /etc/security/limits.conf
. Log out and in to take effect.
Hardlimit: The boundary for a certain user - can not be increaed by that user during runtime, only decreased: ulimit -Hu 2000
. List of Hardlimits: ulimit -Ha
Softlimit: A "soft" boundary within the hardlimit, can be changed by the user during runtime: ulimit -Su 10000
.List of Softlimits: ulimit -Sa
Change ulimits for a running process: prlimit -p $$ --nproc=1200:
. This will change the number of processes (softlimit) to 1200 for the current shell $$
.
add a comment |Â
up vote
1
down vote
You can change the limits in /etc/security/limits.conf
. Log out and in to take effect.
Hardlimit: The boundary for a certain user - can not be increaed by that user during runtime, only decreased: ulimit -Hu 2000
. List of Hardlimits: ulimit -Ha
Softlimit: A "soft" boundary within the hardlimit, can be changed by the user during runtime: ulimit -Su 10000
.List of Softlimits: ulimit -Sa
Change ulimits for a running process: prlimit -p $$ --nproc=1200:
. This will change the number of processes (softlimit) to 1200 for the current shell $$
.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can change the limits in /etc/security/limits.conf
. Log out and in to take effect.
Hardlimit: The boundary for a certain user - can not be increaed by that user during runtime, only decreased: ulimit -Hu 2000
. List of Hardlimits: ulimit -Ha
Softlimit: A "soft" boundary within the hardlimit, can be changed by the user during runtime: ulimit -Su 10000
.List of Softlimits: ulimit -Sa
Change ulimits for a running process: prlimit -p $$ --nproc=1200:
. This will change the number of processes (softlimit) to 1200 for the current shell $$
.
You can change the limits in /etc/security/limits.conf
. Log out and in to take effect.
Hardlimit: The boundary for a certain user - can not be increaed by that user during runtime, only decreased: ulimit -Hu 2000
. List of Hardlimits: ulimit -Ha
Softlimit: A "soft" boundary within the hardlimit, can be changed by the user during runtime: ulimit -Su 10000
.List of Softlimits: ulimit -Sa
Change ulimits for a running process: prlimit -p $$ --nproc=1200:
. This will change the number of processes (softlimit) to 1200 for the current shell $$
.
answered Dec 13 '17 at 19:25
chevallier
8521116
8521116
add a comment |Â
add a comment |Â
up vote
0
down vote
You can change the number of limits in file /etc/security/limits.conf
(for particular user or for everyone)
You should add like this:
username soft nofile 4096
username hard nofile 5120
and this will set number of open files to 4096 (soft limit) and 5120 as top
After this edit you need to relogin and restrart the service(s) to get this in charge.
As far as I remember ulimit
will make changes only till you logout from this user
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I knowsysctl
will change the parameter in kernel, but if you have limit inlimits.conf
they will limit you
â Romeo Ninov
Dec 13 '17 at 16:01
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (LimitFiles
if I remember correctly.)
â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits forroot
user, logout, login again and run it
â Romeo Ninov
Dec 13 '17 at 16:22
 |Â
show 3 more comments
up vote
0
down vote
You can change the number of limits in file /etc/security/limits.conf
(for particular user or for everyone)
You should add like this:
username soft nofile 4096
username hard nofile 5120
and this will set number of open files to 4096 (soft limit) and 5120 as top
After this edit you need to relogin and restrart the service(s) to get this in charge.
As far as I remember ulimit
will make changes only till you logout from this user
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I knowsysctl
will change the parameter in kernel, but if you have limit inlimits.conf
they will limit you
â Romeo Ninov
Dec 13 '17 at 16:01
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (LimitFiles
if I remember correctly.)
â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits forroot
user, logout, login again and run it
â Romeo Ninov
Dec 13 '17 at 16:22
 |Â
show 3 more comments
up vote
0
down vote
up vote
0
down vote
You can change the number of limits in file /etc/security/limits.conf
(for particular user or for everyone)
You should add like this:
username soft nofile 4096
username hard nofile 5120
and this will set number of open files to 4096 (soft limit) and 5120 as top
After this edit you need to relogin and restrart the service(s) to get this in charge.
As far as I remember ulimit
will make changes only till you logout from this user
You can change the number of limits in file /etc/security/limits.conf
(for particular user or for everyone)
You should add like this:
username soft nofile 4096
username hard nofile 5120
and this will set number of open files to 4096 (soft limit) and 5120 as top
After this edit you need to relogin and restrart the service(s) to get this in charge.
As far as I remember ulimit
will make changes only till you logout from this user
answered Dec 13 '17 at 15:53
Romeo Ninov
4,36811625
4,36811625
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I knowsysctl
will change the parameter in kernel, but if you have limit inlimits.conf
they will limit you
â Romeo Ninov
Dec 13 '17 at 16:01
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (LimitFiles
if I remember correctly.)
â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits forroot
user, logout, login again and run it
â Romeo Ninov
Dec 13 '17 at 16:22
 |Â
show 3 more comments
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I knowsysctl
will change the parameter in kernel, but if you have limit inlimits.conf
they will limit you
â Romeo Ninov
Dec 13 '17 at 16:01
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (LimitFiles
if I remember correctly.)
â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits forroot
user, logout, login again and run it
â Romeo Ninov
Dec 13 '17 at 16:22
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
Thanks, does that mean that the change that I did so far has no effect until I change the soft and hard limit too? And how would you set the limits for everyone and not just a specific username?
â SJ19
Dec 13 '17 at 15:59
I am afraid so, as far as I know
sysctl
will change the parameter in kernel, but if you have limit in limits.conf
they will limit youâ Romeo Ninov
Dec 13 '17 at 16:01
I am afraid so, as far as I know
sysctl
will change the parameter in kernel, but if you have limit in limits.conf
they will limit youâ Romeo Ninov
Dec 13 '17 at 16:01
2
2
CentOS7 may or may not also need corresponding entries in the systemd service file. (
LimitFiles
if I remember correctly.)â Ulrich Schwarz
Dec 13 '17 at 16:02
CentOS7 may or may not also need corresponding entries in the systemd service file. (
LimitFiles
if I remember correctly.)â Ulrich Schwarz
Dec 13 '17 at 16:02
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
I should mention that I'm running my program in a screen on root user, does that make a difference?
â SJ19
Dec 13 '17 at 16:20
@SJ19, I do not think so. Change the limits for
root
user, logout, login again and run itâ Romeo Ninov
Dec 13 '17 at 16:22
@SJ19, I do not think so. Change the limits for
root
user, logout, login again and run itâ Romeo Ninov
Dec 13 '17 at 16:22
 |Â
show 3 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410672%2fincreasing-open-files-limit-for-all-processes-do-i-need-to-set-soft-hard-limits%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
the error you get "after a day or two"... Does the problem appear when there's a large number of simultaneous users, or at arbitrary times after the server has been running sufficiently long? I.e. do we know it's not just opening files all the time, but neglecting to close them?
â ilkkachu
Dec 13 '17 at 20:34
Yes it mostly happens when it's been populated for a while.
â SJ19
Dec 15 '17 at 19:54
@ilkkachu It mostly happens after 2 busy evenings, where people have been leaving and joining frequently.
â SJ19
Dec 15 '17 at 20:03