One of my web server was DDOS attacked. All is well except there are millions of PHP session files used up 100% inodes of the partition. There is only one partition for the entire /
Tried several solutions, but only worked to some extend. https://unix.stackexchange.com/questions/37329/efficiently-delete-large-directory-containing-thousands-of-files?newreg=07f276292205457ab9975a0ea68e9273
http://www.slashroot.in/which-is-the-fastest-method-to-delete-files-in-linux
After freed up 8% of inodes, the disk become extremely slow to delete anything more.
rm -f filename*
rsync -a --delete empty_dir/ yourdirectory/
perl -e 'for(<*>){((stat)[9]<(unlink))}'
And the disk look like this now
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda1 2621440 2385895 235545 92% /
tmpfs 128789 1 128788 1% /dev/shm
There are still 6million+ small files in a dir. The above methods delete at about 2 files/sec
I read about b-tree re-balancing. But how do I diagnose/solve the slow delete problem?
```