prestoav

[SOLVED] Extremely slow to open / save one template type in admin

Recommended Posts

prestoav    41

Now solved, see reply at the bottom.

Hi all.

PW version: 3.0.42

Despite the usual speediness of PW, a site I'm working on at the moment is suffering an extremely slow load and save time in admin. We have the same site running on localhost (a brand new MacBook Pro with 3.1GHz processor / 16GB RAM) and a Media Temple VPS host both installations suffer in the same way.

All pages open and save in admin very quickly with the exception of pages using one template which just happens to be the most used one (for products the site owner manufacturers).

Opening the page to edit, or saving the page, can take more than a minute! The whole front-end of the site slows while this is happening. I should add that no caching is turned on at the moment, save the standard PW system. We are, however using the multi-language support with 6 languages installed.

The template consists of the following number/type of fields:

  • 1x PageTitleLanguage 
  • 3x TextLanguage
  • 4x Page
  • 4x Repeaters (2-3 fields, typically text / image / textarea / page, in each - up to 10 entries per repeater)
  • 1x RepeaterMatrix (3 fields in each, up to 3 entries per repeater)
  • 2x TextArea
  • 1x TextAreaLanguage
  • 3x Image
  • 8x Text

Has anyone had an experience like this before? Is this expected behaviour with this number of fields in a page (it's the first time I've used this many on one template)?

As always, any help would be gratefully received!

Share this post


Link to post
Share on other sites
Macrura    2,142

wow for one i can say that is a lot of repeaters, each with a lot of fields. You probably need to ajax load the repeaters and repeater matrix fields to start, or put them all on a tab and ajax load that whole tab.

with up to 10 entries on a repeater holding text, image, textarea (is this RTE?), and page ref (how many pages, and what inputfield are you using?), i would probably have gone with page table instead, though it might work.

Also, assuming your MySQL instance is localhost? i have sometime seen some slowdowns when using MySQL hostnames, due to the additional DNS lookups; Have you tried optimizing and repairing all of the tables?

also you may want to experiment with auto join for some fields here, but be careful, sometimes autojoin can cause problems...

  • Like 2

Share this post


Link to post
Share on other sites
prestoav    41

Hi Macrura, 

Thanks for replying. really appreciated. I'll try the AJAX loading the repeaters. From memory, they are set this way already but I'll check.

You're right in that both hosts are running the DB in localhost so no DNS in the way. Good idea though and I'll keep that in mind for the future.

Will keep looking!

Share this post


Link to post
Share on other sites
prestoav    41
13 hours ago, Macrura said:

wow for one i can say that is a lot of repeaters, each with a lot of fields. You probably need to ajax load the repeaters and repeater matrix fields to start, or put them all on a tab and ajax load that whole tab.

with up to 10 entries on a repeater holding text, image, textarea (is this RTE?), and page ref (how many pages, and what inputfield are you using?), i would probably have gone with page table instead, though it might work.

Also, assuming your MySQL instance is localhost? i have sometime seen some slowdowns when using MySQL hostnames, due to the additional DNS lookups; Have you tried optimizing and repairing all of the tables?

also you may want to experiment with auto join for some fields here, but be careful, sometimes autojoin can cause problems...

Hi Macrura,

Looks like all the repeaters are set to AJAZ load anyway (default behaviour).

Are there any tutorials on creating a new tab in an admin page that you know of (not done that before)?

Share this post


Link to post
Share on other sites
szabesz    1,378
16 hours ago, prestoav said:

Opening the page to edit, or saving the page, can take more than a minute!

While the issue of opening an Edit page being very slow can be caused by repeaters, the save operation being very slow cannot. That leads me to suspect that this issue will not be solved by moving fields to an ajax loaded tab, correct me if I'm mistaken.

Not free but if you really get stuck, this one can help: https://processwire.com/api/modules/profiler-pro/ especially since Ryan's person-to-person support comes with it as well: https://processwire.com/api/modules/profiler-pro/#here-to-help-you

  • Like 2

Share this post


Link to post
Share on other sites
bernhard    1,312
3 hours ago, prestoav said:

Are there any tutorials on creating a new tab in an admin page that you know of (not done that before)?

no need for a tutorial - it's too simple ;) just add a fieldsettab to your page, save it, then you'll get a warning and a second field called yourfield_END. place your fields in between those fields and they will be presented in a tab.

there is a little issue with ajax tabs though: https://github.com/processwire/processwire-issues/issues/332

are you using tracy debugger? are you using any hooks? any modules?

 

  • Like 1

Share this post


Link to post
Share on other sites
prestoav    41

Thanks berhard for the FieldSetTab option. Another very cool PW feature I didn't know about. That will come in useful!

Sadly though in this case it's not made any difference to the load and save page of the pages with that template, despite moving some of the 'big hitters' from the page into tabs :-(

Share this post


Link to post
Share on other sites
bernhard    1,312

i would have been surprised if that had made a difference ;) thats why i asked this:

21 hours ago, bernhard said:

are you using tracy debugger? are you using any hooks? any modules?

  • Like 1

Share this post


Link to post
Share on other sites
prestoav    41
1 minute ago, bernhard said:

i would have been surprised if that had made a difference ;) thats why i asked this:

Ah, sorry missed that!!!

No hooks and no modules (other than core and ProFields repeater matrix) related to that template. Repeater Matrix is working on other templates OK and is only used once in the offending template.

I've not come across Tracey debugger before. Do you mean this: https://modules.processwire.com/modules/tracy-debugger/ ?

Thanks again.

  • Like 2

Share this post


Link to post
Share on other sites
bernhard    1,312

yes, tracy is awesome and would recommend you having a look ;) though sometimes it slows things down a little. i also experienced that the debug mode can slow down things.

in your case i would do the following:

  • backup
  • install tracy and see if you find any strange things (errors, many redirects etc)
  • create a new template, check performance
  • if performance is ok, add fields of your slow template one by one and check after adding each field. if it slows down at some point you could investigate further
  • Like 1

Share this post


Link to post
Share on other sites
szabesz    1,378
2 minutes ago, bernhard said:

install tracy

Also, with @adrian's Tracy Debugger module, you can try this to identify possible modules causing the issues: https://processwire.com/blog/posts/introducing-tracy-debugger/#module-disabler-panel
Also there is a tool which might help tracing down problematic hooks: Event Interceptor Panel

  • Like 2

Share this post


Link to post
Share on other sites
prestoav    41

Now solved!!!

The issue turned out to be one page field within a repeater.  I'd set 'Template of selectable page(s)' to 'blog-post' and then set 'sort=-blog_date' in the 'Custom Selector to find selectable pages' field thinking the two selectors would combine. Turns out they don't, at least not in this way.  All pages, repeaters and other admin sub pages were selectable within this field. The site has hundreds of pages, many with a large number of repeaters in so every time the page admin was loaded / saved it read all of them.

Combining the required filters with only the statement 'page-template=blog_post,sort-=blog_date' for this page field did the trick and the admin for this template (and saving pages with this template) now works really quickly.

Phew!

  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By benbyf
      PW Admin doesn't really function without javascript, and my question would be, should we care?
      I think, however, either way it might be nice to add a "<span>Javascript doesn't seem to be available, therefore you may not be able to access the full functionality of the admin</span>" somewhere maybe?
    • By hellomoto
      I have reduced the module to this and the same error persists:
      <?php class PortalDashboard extends Process implements Module { public static function getModuleInfo() { return array( 'title' => "Portal Dashboard", 'version' => "0.1", //'permission' => array("page-lister"), 'autoload' => false, 'singular' => true, 'permanent' => false, 'requires' => array("PHP>=5.4.0", "ProcessWire>=3.0", "CatCoCustoms"), ); } public function init() {} In the red:
      Furthermore
      When I uninstall the aforementioned module this doesn't happen, oddly enough. What could be the problem?
    • By noelboss
      This module hooks into the login method to provide the possibility to login with the user's email address. This is my first module and it's very simple. Please provide feedback if you have any suggestions. Thanks
      The module can be found in the module repository:
      https://modules.processwire.com/modules/login-with-email/
      or on github:
      https://github.com/noelboss/LoginWithEmail
       
    • By hellomoto
      Pressing problem at initial posting:  I am working on a module that runs/previews (for pub/unpub) imports on importer page view. The template has to be in site/templates, so far as I know, so one is created there on install which includes a file to run from within the module, but then when it's run and tries to read the importer csv file it cannot, since it's in the admin, I guess... Is it possible to set the template page to a file in the module directory? Will that work?
      https://bitbucket.org/chimmel/pw-import-everything
    • By rolisx
      Hi Everyone
      I have a problem here. I have built a site with Processwire on localhost and then transferred to my customer's server. a) it's a windows server (unfortunately) and b) there is a domain-mapping for this site, the domain points to a folder of another domain. Sorry, I can't explain it any better, I don't really understand the different types of servers (why do they have to be different anyway...).
      My problem is, that I see the main website but not the admin page. Do I have to add anything to my .htaccess file?
      I also tried to include web.config file. Not .htaccess nor web.config file have an impact when changing its content. I really have no clue what to do!!
      Links: mcconnellacademy.ch, mcconnellacademy.ch/admin
      Thanks for any pointing in the right direction!