Faced with the limitation of ext3. In the directory you can create a maximum of 32000 subdirectories. There is a patch that allows to increase this value to 65000, but it's still not enough:)
Could you tell me whether there are similar limitations in ext4?