7

I had a node add form with around 50 fields, mostly text with 1 field collection (with another 5 fields) and a few entity and term references.

The page is taking around 30 seconds to load making it unusable.

There are several slow queries (99.28 - DrupalDatabaseCache::getMultiple, 34.21 - views_plugin_query_default::execute, 20.51 - DrupalDefaultEntityController::load, 18.46 - DrupalDatabaseCache::getMultiple, 17.46 - DrupalDatabaseCache::getMultiple.. they go on)

The Cache::getMultiple query has 1087 placeholders, and the EntityController::load has 1084 placeholders.

If a click on the "Add Another Item" on the field collection that takes a further 30 seconds to complete.

What can I do to speed up the load times of the page?

EDIT: I just installed APC which removed all of the caching queries but did not solve the problem - still around 30 second load time. I don't think the slow load times are related to caching. Is taking around 280MB of memory load build the page.

EDIT: Removing the field collection, installing memcache and entitycache has shaved 20 seconds off the load time. However 10 seconds to initially load the page and another 10 seconds per ajax request is still unacceptable. How do webforms perform with a large number of fields? Maybe that would be a better option?

  • 4
    You could also try memcache for cache bin storage, APC for op-code caching. After that entitycache is an easy way to improve entity load performance – David Thomas Mar 10 '14 at 10:31
  • 1
    After looking at the XHProf log I removed the field collection and that took 15 seconds off. I'm now using the multifield module instead despite it being unstable. Installing memcache and entitycache took another 5 seconds off so now I'm down to under 10 seconds. – Felix Eve Mar 11 '14 at 11:04
3

Have you considered using multistep forms for your node creation?

Given that you have a lot of fields, you can do it at multiple page loads via various logical steps. There are lots of tutorials for multistep form implementation in Drupal and the example module ships with one.

  • I think this is a great suggestion. I've made the form as fast as I can keeping it on one page. If the client is unhappy with the load times then I will suggest this as an alternative. – Felix Eve Mar 12 '14 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.