3

I measure time of my batch node creation and it's fairly acceptable at the beginning with, let's say 200 nodes, and totally disappointing at 1700 nodes. After some measurements I found out that the culprit is the node_submit / node_save part. For loop of 20 nodes creation it takes 5-6 seconds for each node to happen.

Where should I look for optimization? Is it some heavy module ruining my performance? Maybe it's some devel function that slows it down.

On almost empty base my call runs for 8 secs. When there's about 1600 nodes in the base I have to wait 120 secs! (loop of 20-21 nodes 5 secs each).

4
  • What modules are you using? Are you doing this on a local machine or live? What's the environment? Sep 26, 2012 at 15:43
  • This is live version, runned from a server which offers drupal instances for its users. Modules used? Hard to tell which are interesting.. Workbench, Devel, Chaos Tools, Features, Field Collection, Eva, etc... and few written by my own. Environment? 5.3.3 PHP, Apache/2.2.15, client MySQL: 5.1.61. Drupal 7.14, Db system ver. 5.5.20-log, memcache 3.0.5, php mem limit 512M.
    – wtk
    Sep 26, 2012 at 15:52
  • Well, it's impossible to say without the list of those modules and without the explanation on what your custom modules do. This can be caused by any module that interferes with saving the nodes. Try doing this on a completely clean install (you can generate the nodes with devel's generate module) and post back. Sep 26, 2012 at 17:51
  • yes, I imagine it really is difficult to say. I try to create nodes apart from the process and it's way faster. I need to find reason for which it works slow for the other script. thanks for your time!
    – wtk
    Sep 27, 2012 at 8:36

1 Answer 1

0

I found the culprit. After turning most of the modules I found out it's WORKBENCH.. Probably it has efficiency problems. Now instead of 15-20 seconds it takes 1 sec to node_save.

2
  • 1
    I was reading this question hoping to find a solution for my 1s saving times, I'm disappointed to see it's "normal".
    – Bart
    Sep 28, 2012 at 9:40
  • If you've got lots of fields then you're going to increase the MySQL load with all of those joins (and revision table joins via workbench or by enabling revisions in general); if you have lots of kinds of fields then on the PHP side it's going to be more intense with the different field_attach, field_presave, etc., functions that will run and potentially more .inc files that would be loaded. Dec 29, 2012 at 18:52

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