On my Linux vServer the inodes are limited (maximum is 250k). I found that an Yii2 (PHP, MySQL, composer) installation requires quite a lot of inodes. The number of inodes is roughly the number of files and directories.
The number of inodes used in the current directory and its subdirectories can be determined with
find . -xdev -printf '%h\n' | sort | uniq -c | awk '{total = total + $1}END{print total}'
An average of my Yii2 projects is about 30k inodes. There are not much in files in ./web/assets
, in the ./runtime
or ./web/images
folders. Most of the inodes are used in the ./vendor
directory.
So the number of my Yii2 projects is limited to 8 projects which is far too low for me.
What can I do to reduce inode usage in Yii2 projects?