How to increase Inodes limit

I’m facing a low storage issue in cyber panel form for many days and after searching many blogs, and videos and talking to many people. I found that the low storage problem is because my Inodes are 100% used.

In some situations my phpmyadmin is not opening then, i delete some cache and files then after some Inodes were free and then, phpmyadmin start working normally. But, I know this is not the solution.

I want to increase the Inode limit. Anyone, please help me to increase the limit of Inodes so, I didn’t face any problem of low storage in your device error in the future? I have still 52% storage available. But, inodes is 100% used.

Welcome @abhishant Happy you are here

  1. This maybe an indication of too many log files:
  • Run this command in your terminal to remove all logs generated rm -rf /usr/local/lsws/logs/*
  • Go to https://SERVER_URL:7080/index.php#view/confMgr.php?m=serv&p=log and setup Keep Days which specifies how many days the access log file will be kept on disk, Compress Archive allow compressing rotated log files in order to save disk space. Also reduce the rolling size of Access log
  1. This maybe an indication of a process opening too many files than the web server allows. Follow this guide

Additional context: Maybe you need to apply cgroups for your clients

1 Like

I run this command for log file removal but still server Inodes is full. I have to host a
client website which is in WordPress, but, I’m not able to do it because of this low space error. My ec2 volume space is free but, Inodes is full so, sometimes my PHPMyAdmin not starting, and facing many issues because of this issue. You can see this in the image. I deleted one website then some Inodes are free and now I"m able to open phpmyadmin. But, this is not the solution. I have to host a website.
Screenshot 2022-10-24 124004

Solutions 1:

Set system-level file descriptor limits:

# check the current process-level file descriptor limit
$ more /proc/sys/fs/file-max  # or ulimit -n
# if its lower than 65000
$ echo 65000 > /proc/sys/fs/file-max
# adjust no. of processing units available
$ echo "10000" > /proc/sys/fs/nr_open
# assuming you are running linux kernel 2.2 adjust no. of maximum files that can be stored in file system
$ echo 65535 > /proc/sys/fs/inode-max
# reboot server
$ reboot
1 Like

This is not working for me.

I’m not able to understand what is the problem was going on with me. Please help me to resolve this issue.

This confirms that you have increases the number of open files allowed by processes on your system. Kindly follow the instructions I posted earlier or you can run this command to maximise the limit (not recommeded but should solve this):

$ ulimit -u unlimited

Note: For the purpose of helping the community always copy-paste the error you get alongside the screenshot to help others search the issue and find your question

Thanks for your help and support Sir, please provide me with the method by which I will increase the limit of Inodes. Because now I have to delete the old website to host a new one because Inodes is 100% used. Because of this problem, I’m not able to upload any plugin, image or file through cyber panel. This is a very big issue for me. So, please help me to increase the Inodes limit.

@abhishant we have already i idnetified the issue together here.

With this said, kindly follow the steps i gave here if all fails run the command here

Just open your terminal and run them as they are. I have added comments for you to understand why you have to run each and every command.

I run all commands and this will fix the WordPress installation issue but, the main issue is Inodes. I have to delete my old website for the installation of new website. Do we google meet or anydesk to shwo what the issue is.

Use control groups aka cgroups:

  1. verify that you are running cgroups v2:
$ ls /sys/fs/cgroup/cgroup.controllers
  1. Check available features to control:
$ cat /sys/fs/cgroup/cgroup.subtree_control
  1. Adjust TasksMax - the number of tasks that can be started by a user. This ensures that the number of tasks accounted for the user stays below a specific limit. A reasonable value might be 2500.
# make a drop-in file
$ mkdir -p /etc/systemd/system/[email protected]
$ cat > /etc/systemd/system/[email protected]/delegate.conf << EOF 
[Service] Delegate=tasks cpu io memory pids cpuset 
EOF
$ systemctl daemon-reload
  1. Configure the user you want to control by using linger, enter the following:

loginctl enable-linger admin

You can see if a user is lingered by entering:

loginctl user-status admin

  1. To enable cgroups at the server level, in OpenLiteSpeed WebAdmin, navigate to Server Configuration > Security , edit the CGI Settings group and enable cgroups by setting it to on

Note: Avoid systemctl configuration if you see it in any tutorial in the web

Were is the CGI Setttings

Go to https://SERVER_URL:7080 and if you experience any issues lookup this tutorial

OpenLiteSpeed WebAdmin, navigate to Server Configuration > Security , edit the CGI Settings group and enable cgroups by setting it to on

Screenshot 2022-10-25 013549
Screenshot 2022-10-25 013523

You do not have cgroups v2. Setup cgroups:

1.Using drop-In files method

For each user you wish to configure, you will need to create a directory in mkdir /etc/systemd/system/user-UID.slice.d. e.g.mkdir /etc/systemd/system/wordpressuser-1001.slice.d

$ cd /etc/systemd/system/wordpressuser-1001.slice.d
echo "[Slice]" >> 50-TasksMax.conf
echo "TasksMax=10%" >> 50-TasksMax.conf

Validate the file changes by running cat 50-TasksMax.conf

To use cgroups with OpenLiteSpeed you need to install glib as root.

RedHat/Centos: sudo yum install glib2
Ubuntu: sudo apt-get install glib2.0

In OLS WebAdmin, configure OpenLiteSpeed to have CGI apps use the user ID of the owner of the file. Navigate to Configuration > Virtual Hosts > and select the virtual host you wish to manage. In the Basic tab, modify the Security entry and set the ExtApp Set UID Mode to CGI File UID

To enable cgroups at the server level, in OpenLiteSpeed WebAdmin, navigate to Server Configuration > Security , edit the CGI Settings group and enable cgroups by setting it to on

Note: Avoid systemctl configuration if you see it in any tutorial in the web

Please explain were is the option is - In OLS WebAdmin, configure OpenLiteSpeed to have CGI apps use the user ID of the owner of the file. Navigate to Configuration > Virtual Hosts > and select the virtual host you wish to manage. In the Basic tab, modify the Security entry and set the ExtApp Set UID Mode to CGI File UID

Go to Virtual Hosts > example.net In the Basic tab, modify the Security entry and set the ExtApp Set UID Mode to CGI File UID

I’m not able to find. Please guide me form below image

Click on Virtual Hosts from left sidebar > example.net In the Basic tab, modify the Security entry and set the ExtApp Set UID Mode to CGI File UID

Also check out this documentation

I have to do this for all domains? Because, I have more than 49 domains hosted on this panel. So, I have to do this process for all domains.

Question: Does this process will increase Inodes or I didn’t face Inodes exhaust problem in future after doing this process. Or if i was wrong then please tell me about this.