ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Incredibly slow CP as a result of File locking on NFS

August 30, 2012 9:21am

Subscribe [3]
  • #1 / Aug 30, 2012 9:21am

    Ian Young

    200 posts

    This question may be related to a resolved thread.

    Also referenced to CodeIgniter forum thread: http://ellislab.com/forums/viewthread/150496/#735762

    I just wanted to check on the current situation with regards to flock() functions in ExpressionEngine with regards to the above linked thread. Does it still use flock() and has there been a feature request and subsequent configuration setting in EE 2 as a result?

    To sum up my particular problem, I’ve just moved to a cloud-based hosting environment where they are using NFS. Upon setting up EE to match my local copy the Control Panel was incredibly slow to both log in and navigate between pages — taking a minute or two each time. After working with my hosts they were a great help and pointed out the problem with file locking via flock() on NFS which was the primary cause. In the above thread it looks like MediaTemple pointed out the same thing. My hosts greatly improved things so now it’s fast and responsive but they had to edit core EE files in commenting out sections regarding flock(). This obviously isn’t a long term solution and will break when I next upgrade so I really need a way to prevent this from happening again — some configuration setting or a removal on the reliance of flock altogether.

  • #2 / Aug 30, 2012 11:37am

    Ian Young

    200 posts

    I think the main culprit is the output.php file where it’s writing the cache: system/codeigniter/system/core/Output.php

    I’ve just spoken to my hosts again and they seem to think that the use of flock can be safely removed. Either way I really need one solution or other which will stand the test of EE updates before the next update comes out. Having a choice between hacking core files, no EE updates, or an unusably slow CP aren’t really good options to have to choose from.

    Hope someone can shed some light on this, I’m sure there’s some workable solution but it would be good to hear from the devs on it.

  • #3 / Aug 31, 2012 12:55pm

    Shane Eckert

    7174 posts

    Hi Slippy,

    Thank you for posting your question here on the ExpressionEngine forums.,

    I do not see the code being modified to exclude flock at this point. The best thing to do is keep track of the modifications to the core files so you can reproduce those again after an update.

    Is there anything else I can help with?

    Thank you!

  • #4 / Aug 31, 2012 1:05pm

    Ian Young

    200 posts

    Hi Shane,

    It’s been two years since those related posts and it’s a problem on any cloud-based hosting environment including the likes of MediaTemple and their Grid Service. The reply in the linked thread from MT is similar to that of my current host in that it causes a big issue. The link to the CodeIgniter forums highlights the same issue. It was mentioned in the linked thread that it could be added as a feature request. Has this request not been made in the two years since or has it still not been acted on? In that time what was the decision and why? Is there no way this could be added as a config file variable or something which would at least allow those in NFS environments to turn it off without hacking core files. That leaves things open to problems right away and isn’t a very good upgrade strategy and leaves it open to problems as different people are involved with the project in the short and long term.

    I’d really like to understand why it is essential for it to be in there and why it couldn’t be set as a config file variable or any other means that could provide an easy way to manage this situation.

  • #5 / Sep 04, 2012 5:03pm

    Robin Sowell

    13255 posts

    Hi Slippy- turning it off- i.e., not locking the files- isn’t a great option.  So it’s not just a matter of skipping the flock based on a config- which would be a pretty easy addition.  But it’s not a good solution.  Given the issue is largely avoided by not caching (which I’d likely suggest not doing anyway) or saving templates as files, most of the negatives can be avoided if you’re on a NFS server setup.

    However- you’re right that it could interfere with updates, where the config file needs to be written to.  Is it stalling out on you between versions?

     

  • #6 / Sep 04, 2012 5:38pm

    Ian Young

    200 posts

    Hi Robin,

    Thanks for getting back to me. As far as I know I’m not caching but the platform makes use of memcache rather than writing to files. Again, it’s something I dont’ have control over unfortunately. As for the templates, not saving them to files really isn’t an option as it all needs to version controlled and runs through from local to dev to staging servers before being pushed live. It would be unworkable not to have them saved as files.

    As of yet I’ve not had to update but obviously I will need to when the next update is released and for the remainder of the site’s or EE’s lifespan. If you can recommend a good solution to solve the problems then I’d be happy to give it a try.

  • #7 / Sep 06, 2012 1:03pm

    Robin Sowell

    13255 posts

    Ah- memcahe is actually a much better way to go, as long as it’s setup right.  So no worries there.  But you are definitely running into issues when you try to save templates as files from w/in the cp?  Or when you update a config value such as ‘Enable/Disable Extensions’ (that one’s saved in the config file)?

    If so- it sounds like the server setup would make a good test case.  I’ve dropped you an email with some details on how we can make that happen.  It will be a little while before we can actually go in and start testing- the first possible solution is not a small change, so this is going to take some time and need to work into some ongoing projects.  But if you’re up for it, let me know via email reply and we’ll see what we can make happen.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases