iamtheboss Posted December 8, 2018 Share Posted December 8, 2018 How is possible to reduce the inode ? What we can delete and what no ? Thanks After removing this folder the inode usage dropped back within the normal range. /dev/simfs 2000000 970484 1029516 49% / Your current inode count is now at about 970k and we have removed the extra 500k inodes we loaned to you. Link to comment Share on other sites More sharing options...
Simonas Invertus Posted December 10, 2018 Share Posted December 10, 2018 Try to delete and disable caching and see if it's affects your inode number. Link to comment Share on other sites More sharing options...
MasterDel Posted May 13, 2021 Share Posted May 13, 2021 (edited) Hello, prestashop version 1.7.7.4 The main problem with inodes is that when images are loaded, a lot of folders and files are created. See here The solution is as follows, in the file classes/Image.php change the function public static function getImgFolderStatic($idImage) { if (!is_numeric($idImage)) { return false; } $folders = str_split((string) $idImage); return implode('/', $folders) . '/'; } to public static function getImgFolderStatic($idImage) { if (!is_numeric($idImage)) { return false; } $folders = str_split((string) $idImage); return ''; #return implode('/', $folders) . '/'; } further should be changed .htaccess file # Images My Solution RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5$6.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5$6$7.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5$6$7$8.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteCond %{HTTP_HOST} ^mydomain$ RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1$2$3$4$5$6$7$8$9$10.jpg [L] ##############Prestashop Original################################ #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] #RewriteCond %{HTTP_HOST} ^mydomain$ #RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] mydomain must be changed to real domain It's all. Best regards Edited May 13, 2021 by MasterDel (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted May 16, 2021 Share Posted May 16, 2021 If I understand it well you go back to the Prestashop 1.3 image filesystem where all images were in the /p directory... Link to comment Share on other sites More sharing options...
MasterDel Posted May 18, 2021 Share Posted May 18, 2021 Yes, but it is better to switch to a more powerful hosting Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now