Login Form






Lost Password?
No account yet? Register

Donate to A.R.T.

Polls

What OS are you using?
 

Advertisement

Syndicate

powered_by.png, 1 kB

Home
Neat Filesystem trick Print E-mail
Written by scott   
Wednesday, 03 May 2006
Lets say you've added an extra disk to your system, and youve got a couple of very large virtual hosts that you'd like to move to that other disk, one thing you can do is rebind one part of the filesystem to another. Letting you move file systems around the system, without the need for symbolic links, using the mount --bind command.

On one of my plesk servers, the system never had enough drive space to host more than a handful of systems, so we added a file system off an NAS (network attached storage) to fill in the blanks. This was mounted as /home/httpd/vhosts, and while it solved the file system issues, it added latency to the sites since they were all running over NFS.

2 of the sites on the box are very high volume, www.ice.org, and tiles.ice.org. Both suffered from poor database and filesystem performance, part 1 of the solution involved getting mysql 4 to work correctly with PSA, and part 2 involved moving those sites off the NFS drive to a physical disk. I did this by rebinding a physical disk partition INSIDE of an nfs partion. Heres my fstab so you can see what I'm talking about:

LABEL=/ / ext3 defaults,noatime 1 1
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults,noatime 1 2
/home/httpd/localvhosts/atomicrocketturtle.com /home/httpd/vhosts/atomicrocketturtle.com none bind 1 1
/home/httpd/localvhosts/ice.org /home/httpd/vhosts/ice.org none bind 1 1
/home/httpd/localvhosts/tiles.ice.org /home/httpd/vhosts/tiles.ice.org bind 1 1
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults,noatime 1 2
/dev/sdb2 swap swap defaults 0 0
/dev/sda5 swap swap defaults 0 0
nas1:/vhosts /home/httpd/vhosts nfs rsize=8192,wsize=8192,timeo=14,intr 0 0

I can see this being useful for other environments as well, with multiple physical disks.

To put this in perspective, this is the filesystem performance on creating a 500mb file on an NFS drive:
[root@server4 vhosts]# time dd if=/dev/zero of=boo bs=1024 count=500000
500000+0 records in
500000+0 records out

real 1m44.425s
user 0m0.390s
sys 0m3.240s

and heres the physical disk performance:
[root@server4 atomicrocketturtle.com]# time dd if=/dev/zero of=boo bs=1024 count=500000
500000+0 records in
500000+0 records out

real 0m15.631s
user 0m0.210s
sys 0m6.080s

1 minute 44 seconds on NFS, vs. 15 seconds on the local disk.

The limitations of mount I think only allow you 254 --bind type mounts on an unpatched kernel. The Vserver CTX patches (look up vserver on freshmeat) allow you to get past this limit. Hopefully this is useful to someone other than me :)
Comments

Only registered users can write comments.
Please login or register.

Powered by AkoComment 2.0.3!

 
< Prev   Next >
© 2009 atomicrocketturtle.com :: digital turtlist
Joomla! is Free Software released under the GNU/GPL License.
sheta@atomicrocketturtle.com
Fight Spam! Click Here!