moren...@mailinator.com wrote:
>
> I have a server, rented as a dedicated server from a Web Hoster,
> and it is set up using LVM --- one big pool of 490G of space,
> and three volumes, for /usr, /var, and /home.
>
> I'm facing a situation where a very high number of files are
> being created, to the point of greatly slowing down the system
> (anything that has to do with disk access anyway).
>
> My plan, as a *temporary solution*, is to create multiple
> volumes, say, one for each month, and then mount
> /home/backups/YYYY-MM on each of those volumes.
>
> As an example, I do:
>
> sudo lvcreate -L 1G 2012-09 vg00
> sudo mkfs -t ext4 /dev/mapper/vg00-2012--09
> (BTW, anyone knows why that double dash appears?? It does show
> exactly like I'm typing above)
> sudo mount /home/backups/2012-09 /dev/mapper/vg00-2012--09
>
> My first question is: would this solve anything?? The rationale
> being that if I have, say, 10 thousand files per month, then I
> don't end up with one volume with a filesystem carrying 120 thousand
> files after one year, but instead, 12 volumes with 10 thousand
> each, so access to one of them is not slowed down by the sheer
> amount of files on the others. What I'm not sure is whether the
> slowdown comes from the directory structure itself (in which
> case, wherever each point is mounted would be irrelevant?)
I remember slowness of filesystem formats with linear directories.
Didn't ext formats switch to hashed directories at least as far back at
ext2? I have a few systems with millions of files and once a wide
directory structure was implenented it was okay. So my impression is
hashed directories weren't enough.
I like the fact that you get data isolation but I think most of your
gain will be from taking the old files offline. If you changes your
backup strategy to use files based on that directory stucture you should
get the speed without the new volumes.
> Second question: would the above be safe? I mean, can I do that
> with reasonably low risk on a server that is live (i.e., during
> its operation)?
No problem doing a lot of logical volumes. It's one of the things LVM
is for. Safe. My question isn't the safety of it it's the sanity of
it - Will you be moving those files offline at some point? umount them
and then later lvremove them with a phase of rolling them to tape in
betwene.