In CentOs as from version 6 there is a by default process limit 1024 for every user i.e /etc/security/limits.d/90-nproc.conf
* soft nproc 1024
I have to execute a backend service/daemon "myservice", which require a bigger value in process limits. So I have to override pre-configured limit (1024). For that purpose I tried to create separate entries for root and myuser ( user running myservice ).
myuser soft nproc 5000
root soft nproc 5000
and then
service myservice restart
now limit was increased and seems that issue has been solved! but it was temporarily, after system reboot limit was again to 1024. (NOTE: myservice was configured to start at boot)
It seems that it happened due to init process who is responsible to start each service on system, hence "myserivce" as a child inherited parent's limits (init has 1024 limit by default).
I googled to find if there is any way to increase limits for init, but was not enough lucky to find any! I have tried to alter/etc/security/limits.d/90-nproc.conf
* soft nproc 5000
but still same, after reboot init still have 1024 limit and myservice also has 1024 limit
NOTE: if I restart myservice from shell prompt then it get accepted limits (5000) but I want to start it automatically after every reboot.
Can somebody guide me, How I can increase process limit for "myservice", and preserve it after reboot ?