Solr - Your open file limit is currently 1024

Hi,

I am trying to run Solr and on starting it, I get the following message:

*** [WARN] *** Your open file limit is currently 1024.
It should be set to 65000 to avoid operational disruption.

I have tried a few things to increase the limit, but having no luck so far.

Is there a proper way to do it?

Currently, I have

ulimit -Hn
524288

ulimit -Sn
1024

Thanks

Basic search

https://www.google.com/search?q=increase+ulimit

Thanks. This mentions about sysctl and from my basic search, I learnt that systemd has now replaced sysctl.

You want to change the ulimit setting in /etc/security/limits.conf.

See also /usr/etc/security/limits.conf

Yep: How to set ulimits on service with systemd? - Unix & Linux Stack Exchange

I did. There is no file called : /etc/security/limits.conf

There is one /usr/etc/security/limits.conf and I have already modified but did not get any success. After changing the values and restarting the machine:

  • soft nofile 524288
  • hard nofile 524288

ulimit -Sn
1024

This is expected behaviour.

You should not modify this file. You should create file in /etc/security/limits.d with your settings.

Works for me. Did you try to reboot?

Contradicting claims exist: linux - Increasing nproc for processes launched by systemd on CentOS 7 - Server Fault

“systemd completely ignores /etc/security/limits*.”

Yes, I have rebooted. Did not make any difference.

Show full output of commands in the terminal:

ulimit -Sn
ulimit -Hn
echo $$
systemd-cgls

./solr start
neither jattach nor jstack in /usr/lib64/jvm/jre-openjdk could be found, so no thread dumps are possible. Continuing.
*** [WARN] *** Your open file limit is currently 1024.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] *** Your Max Processes Limit is currently 31193.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh

ulimit -Sn
1024

ulimit -Hn
524288

echo $$
3087

systemd-cgls
This is 163 lines output, is it okay to paste it in here?

You can upload to https://paste.opensuse.org/

Done the paste

You forgot to post the link.

Sorry, new to this…

Here is the link

https://paste.opensuse.org/pastes/4a31973484eb

-.slice
├─user.slice
│ └─user-1000.slice
│   ├─user@1000.service …
...
│   │ ├─app.slice
...
│   │ │ ├─app-org.kde.konsole-8276b9bb2f32403ebf98ccfd710481d5.scope
│   │ │ │ ├─ 3072 /usr/bin/konsole
│   │ │ │ ├─ 3087 /bin/bash
│   │ │ │ ├─30022 systemd-cgls
│   │ │ │ └─30023 less
...
│   └─session-1.scope
│     ├─1319 /usr/libexec/sddm/sddm-helper --socket /tmp/sddm-auth-874fd690-bfad-40d0-a3b6-388e05d8ad1d --id 1 --start /usr/bin/startplasma-x11 --user michael --autologin
│     ├─1331 /usr/bin/startplasma-x11
│     └─1417 /usr/bin/gpg-agent --sh --daemon --keep-display /usr/libexec/xinit/xinitrc

Your shell with PID 3087 does not run as part of login session. It is started by systemd user instance. The limits.conf settings apply only to the processes that are part of user session (these limits are used by pam_limits module executed during login). If you login on the console or via ssh, you will see the expected values.

It is possible to switch KDE back to traditional session management so limits.conf applies. If you do not want it, you need to apply limits to the user systemd units. It can be done globally, for all units, via global configuration file or set only for individual user instance (in your case, for user@1000.service).

The shell is started by me manually by running konsole.

├─ 3072 /usr/bin/konsole
│ │ │ │ ├─ 3087 /bin/bash

Would it still not be perceived as being part of the login session?

It is possible to switch KDE back to traditional session management so limits.conf applies.

How do I go about doing that? My installation of tumbleweed is without any customisation to session management. It is what is provided by default.

kwriteconfig5 --file startkderc --group General --key systemdBoot false

You needn’t do that. More canonical options for changing the limits exist:

  1. Global
erlangen:~ # cat /etc/systemd/system.conf.d/limits.conf 
[Manager]
DefaultLimitNOFILE=2000:999999
erlangen:~ # 
  1. Change the limits of a service:
erlangen:~ # grep NOF /usr/lib/systemd/system/NetworkManager.service
LimitNOFILE=65536
erlangen:~ #