Glusterfs on web server
Solution 1:
That is not a problem at all , remember:
- for many small files with many changes or a locking mechanism ( php sessions ), use NFS mount and read about locking and all nfs mount options like fsc , rsize , wsize ,since there is no built in failover and/or load balancing , you have to invest a few minutes to deploy CTDB a good resource on installing NFS-ganesha is available
- if using fuse client (large files) , use backupvolfile-server for failover
- to do some performance tuning this has been already asked over here
Speed of NFS/FUSE
in another thread , it is stated
From my experience, the performance differences are huge. After switching my web app from FUSE to NFS load times decreased from 1.5 - > 4 seconds to under 1 second. Also I tried extracting some archives today and it seems to take 4-5 times longer on FUSE
a benchmark example is here
Improving FUSE speed:
In the gluster mailing list there are 2 hints on improving speed with negative-timeout :
mount -t glusterfs -o negative-timeout=1,use-readdirp=no,log-level=WARNING,log-file=/var/log/glusterxxx.log 192.168.140.41:/www /var/www
mount -t glusterfs -o use-readdirp=no,log-level=WARNING,log-file=/var/log/glusterxxx.log 192.168.140.41:/www /var/www
So it means only 1 second negative timeout... In this particular test:./smallfile_cli.py --top /var/www/test --host-set 192.168.140.41 --threads 8 --files 50000 --file-size 64 --record-size 64
The result is about 4 seconds with the negative timeout of 1 second defined and many many minutes without the negative timeout (I quit after 15 minutes of waiting)
AND
PS: I already found out that for this particular test all the difference is made by : negative-timeout=600 , when removing it, it's much much slower again.
Solution 2:
Yes, you can run GlusterFS nodes directly on your web server instances, but keep in mind that it can use a lot of CPU, taking away CPU resources from your web application. You should test your app to see if it will have sufficient CPU and other resources to run converged with GlusterFS; if not, you should upgrade the hardware or use dedicated GlusterFS nodes.