Moodle data folder on a shared ntfs volume

Moodle data folder on a shared ntfs volume

by Heather P -
Number of replies: 13

Hello

has anybody got or tried putting their Moodle data folder on to a network storage space as opposed to on an actual server?

We have an Ubuntu / apache web server inside the network and the a clone in the dmz. Both of them connect to the same database (on a windows server) and the same data folder on an ntfs volume on the network.

If you have tried this did it give you any issues? Did it slow your Moodle down in anyway, cause any problems do anything at all that was not beneficial to your Moodle?

Thank you

Heather

Average of ratings: -
In reply to Heather P

Re: Moodle data folder on a shared ntfs volume

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This just sounds like a 'load-balanced' solution with multiple front ends and a shared database/moodledata. This works fine although all front ends *must* be configured identically (especially $CFG->wwwroot). 

You can do that but you may experience increased page loading times. This is because shared storage is often far too slow to store the cache.  The best solution is to run a proper cache server (e.g. memcached). 

See Caching for more info. 

In reply to Howard Miller

Re: Moodle data folder on a shared ntfs volume

by Heather P -

Hi

it is that style of solution, but not really load balanced. It was more of a method of defending against ddos attacks in that one web server is inside the college network and the other is in the DMZ. We had a bit of trouble at the start of the academic year.

We are now, however, reaching the point where we need to load balance. We tried a load test to see what happened, not good springs to mind.

The web server seemed to be fine and the database server. This is what prompted the question. We were wondering if others had already tried it and realised it was too slow.

We do have caching configured, but not as a separate server. Time to look into that.

Thank you

Heather

In reply to Heather P

Re: Moodle data folder on a shared ntfs volume

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

If it is about load-balancing for higher performance, check the resources in https://moodle.org/mod/forum/post.php?forum=94.

One can't say network file systems are bad for moodledata: "It depends" as usual. For example, the Open University UK has the moodledata on a SAN. (See https://moodle.org/mod/forum/discuss.php?d=329722#p1327013.)

The question about NTFS: Are you planning to move to NTFS? I see that presently you have CIFS: https://moodle.org/mod/forum/discuss.php?d=238303.

BTW, the Moodle version really matters. Between 1.9 and 3.0 moodledata took over so many new duties. (Your profile says, "Still pottering on with 1.9 aim to take the plunge on Moodle 2 next summer".)
In reply to Visvanath Ratnaweera

Re: Moodle data folder on a shared ntfs volume

by Heather P -

Thank you.

Well how out of date is my profile!

We are on a Moodle 2.7.11 looking to move to 3 in the summer.

The storage space is ntfs (on a SAN). that is interesting about the OU. I shall get onto those links and update my profile!

Regards

Heather

In reply to Visvanath Ratnaweera

Re: Moodle data folder on a shared ntfs volume

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

OK, Moodle 2.7. By that time Moodle had started using moodledata for many things, including https://docs.moodle.org/27/en/Caching. You need to be thorough on these things. (See Howard's reply.) Also, you need be clear about the aim of the exercise (higher performance, fail-over or DDOS defence, ...). And about the resources you have at your disposal. (As Howard hinted, the performance might even drop!)

Anyway, you seem to have an interesting architecture. The production server is in the LAN and there's a clone in the DMZ. Are both (web) servers Ubuntu/Apache? I went through your previous discussions and read about Windows server and IIS. Also you said "the same database (on a windows server)": What Windows version, what database (and version)? The point is that all these things interact, you can not have answers to isolated questions like, "is moodledata on a shared volume is a good thing". You need to provide full information!

Same thing with "NTFS". It is just a local file sysem. We are talking of exporting/mounting a file system through network. There one need to talk about NFS, CIFS, etc. (Read "Filesystem recommendations for cross-network HA setup?" https://moodle.org/mod/forum/discuss.php?d=329722, which I already mentioned.)

Are you a teacher who looks after the Moodle, the school having a professional IT team? If so, ask the IT people to join moodle.org and discuss directly with the experts here!

@Mod
This is definitely a discussion for the Hardware and performance forum.
In reply to Visvanath Ratnaweera

Re: Moodle data folder on a shared ntfs volume

by Heather P -

Hi

it is always so difficult knowing where to post the questions. I  thought it was performance because it was not performing particularly well under pressure...

No I'm not the teacher, but I do deliver training on Moodle and know how to use it as an end user.

I used to be the installer and maintainer of Moodle (but not the server OS) and then we switched to Ubuntu with Apache for the web ends this year. My Ubuntu skills are currently insufficient to maintain an active Moodle. I still do the database MySQL on a Windows server and now we have a data folder on a nas box.

And currently the web servers and the database servers are on virtual servers.

When we started with Moodle 1.5 it was all on the one physical box and not that many people and life was easy. Somewhere it has got so over complicated.

The  current remit is to have a stable robust Moodle. We are anticipating that there will be more use next year, hence the trying to make it work better. We did a load test (got the computer science students to all be active at about the same time) and it came crashing to its knees. We had a suspicion about the data folder, hence the question.

Thanks to all your pointers and generously supplied information, we are beginning to think the spanner in the works really is the Moodledata folder.

If we can get definite proof that it is the location of the data folder on a network storage drive that is the guilty suspect I will post, but I have a feeling that it may end up being part of the problem, but not the only part.

Heather

In reply to Heather P

Re: Moodle data folder on a shared ntfs volume

by Heather P -

Hi

for those interested. 

We did the test again with better monitoring in place and latency was experienced in accessing our Moodle data folder. Some sort of error (I'm not privy to what that error was) in this area was also found and has now been put right, but we don't think the error was entirely responsible for the latency. We are now looking to move our Moodle data folder off the storage system and instead put it on a server.

In reply to Heather P

Re: Moodle data folder on a shared ntfs volume

by Ken Task -
Picture of Particularly helpful Moodlers

I'll add two cents ... acquired some experience in assisting a large implementation off a no-longer-supported Ubuntu to CentOS ... LTS.   Entity *required* that any DB be served from their DB 'farm' (for lack of a better term ... Virtual OS was VMWare and in their internal 1.9.168.x.x blocks of IP addresses.  DB server CentOS LTS.  Also *required* and file storage to be on their internal NFS/CFS 'farm' ... Virtual OS was VMWare NFS server on CentOS LTS in their 10. blocks of IP addresses.

Speed had always been an issue and while I can't take credit for this, the former admin figured out some things not normally done but did increase the speed/responsiveness of the site.

Basically ... the moodledata directory did reside on the web server.   But, only certain directories were truely on the web server ... sessions, the caches directories, etc.   Those things that apache would need 'quickly'.   The moodledata filedir was really a mount point to the CentOS LTS server dedicated to just that .. storage of files.   trashdir was also located there.  Certain tweaks were required ... example, on the dedicated DB server ... skipnetworking so MySQL wouldn't attempt to do any checking of hostnames.

Plus, the only way to access the backends of any of it via ssh, VPN to either the DB box or NFS box via shell and then back out to the web server.   And, a webmin on the Web server to be able to use something more 'user friendly' to admin both the DB and the File storage.   Webmin locked down and restricted access by certain IP addresses only.

Interesting project and took some time to figure out what previous server admin had done, but worked like a charm.   Did have to tweak time out settings on/in nearly all of it, of course.

Am not saying it's the only way ... just sharing experience.

'spirit of sharing', Ken


Average of ratings:Useful (1)
In reply to Ken Task

Re: Moodle data folder on a shared ntfs volume

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

Thanks for the details Ken...

So, for clarity, did you split the moodledata directory up so that you have some of the moodledata folders on the web server and some of them on the NFS/CFS farm?

And your DB server is a separate CentOS LTS server?

So you basically have three "environments":

  • The web server - containing the Apache web server, the Moodle code and some of the Moodledata folders
  • The NFS/CFS farm containing the remaining Moodledata folders, including the filedir and trashdir folders
  • The dedicated DB server where you put the Moodle MySQL database

Is that correct?

In reply to Luis de Vasconcelos

Re: Moodle data folder on a shared ntfs volume

by Ken Task -
Picture of Particularly helpful Moodlers

Yep, that's about it.   Remember I said, all that was setup like that before by the former Moodle Admin person.  It was because entity had requirements they believe to be the most secure and any/all stuff they ran was basically set up like that.

Kinda a pain and there were/are some bottle necks, but .... it worked ... they were "happy" ... so who am I NOT to be "happy"? ;)

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle data folder on a shared ntfs volume

by Usman Asar -
Picture of Plugin developers Picture of Testers
Ken, can you as well throw a bit light on how dataroot will be configured in config.php. in case of distributed moodledata folders? and preciously what folders are to be shared?
In reply to Usman Asar

Re: Moodle data folder on a shared ntfs volume

by Ken Task -
Picture of Particularly helpful Moodlers

This is from memory ....

There was a physical directory called moodledata on the web server so config.php pointed to that.

Inside moodledata ... sessions, cache, localcache, mdeploy, temp ... anything that required fast access by the web server were true directories.

filedir and trashdir were symlinks that pointed to mount points on the web server that pointed to  NFS mounts ... which could be located in places like /mnt/data/filedir and /mnt/data/trashdir

I had a heck of time convincing the network/server Gods to allow local backups of the code directory and a DB dump remain on the web server ... in places like /home/backup/

Reason for them ... in case site restore was needed ... faster access to that which was more than likely needed to do a site restore.

Web servers had public IP addresses in them but only port 80 opened both ways.

To ssh into server, VPN to the DB box was required, then one could ssh from inside out to the web server.   While in their VPN, was restricted by their filter ... which meant I need to get ducks in a row etc. maybe even store some stuff on my laptop to be able to 'get the job done'.

Ran Tuner on Web server and on DB server.  One would need to tweak mysql according to how the Tuner on the Web server saw things.

As far as Moodle code ... installed via git ... maintained via git - as long as I had access to it.   Recently, however, the server person internal decided to upgrade to 3.0.1 when he read about PHP7 (despite that being pretty much Beta) and when he did, didn't continue to use git ... an action think he will regret taking (at least the git part).   Good to see someone internal taking ownership.  As far as 'loosing a client' ... heck, I've been involved in education all my life where one is supposed to work themselves out of a job - independence.

Best way?   Well, like I said ... they had requirements ... non-negotiable.

Anyone taking this same approach, be prepared to tinker and *document* very accurately for the next person who comes along.  And to expect filedir/trashdir to be slower than if on web server.   Can't get blood out of a turnip!

That help?

'spirit of sharing', Ken

Average of ratings:Useful (1)