Hi,

I've upgraded a D5 site to D7 this weekend. The configuration page is taking >30 seconds to come up. I've added this directive to the .htaccess file:

php_value max_execution_time 60

And I can get the page, but waiting so long for the config page to come up just doesn't seem right. I've disabled all contib modules except devel and get this output.

Executed 124 queries in 18.13 ms. Queries exceeding 5 ms are highlighted.

But still, the page takes >20 seconds to load. Anyone have any ideas where to look next? I'm thinking about moving the site local and seeing if I get the same behavior.

Thanks
Sam

Comments

sam_squarewave’s picture

Moved the site over MAMP on my computer - it now takes about 7 seconds to load the screen. Going to install a fresh install of D7 and see what the deal is.

sam_squarewave’s picture

With a new install the response is great - so what now? Do I have some data cleanup to do in tables? I'm a little confused since the queries don't really take that long.

sam_squarewave’s picture

Also, my wife is mocking me for not switching to wordpress, she said I could have been done a long time ago with this upgrade. Make her stop! ;)

sam_squarewave’s picture

Installed the latest D7 dev release to correct another bug...still no go.

thomas4019’s picture

I'm having the same issue

"Executed 126 queries in 30.57 ms. Queries exceeding 1 ms are highlighted. Page execution time was 30310.66 ms. Memory used at: devel_boot()=1.2 MB, devel_shutdown()=18.71 MB, PHP peak=19.75 MB."

thomas4019’s picture

I'm now thinking the issue is something to do with my server not having outbound internet connectivity. I think it's something to do with the update status or update manager module. Yet, disabling it doesn't help.

thomas4019’s picture

Adding the following to my settings.php fixed it for me,

$conf['drupal_http_request_fails'] = FALSE;

sam_squarewave’s picture

Thanks for the tip - unfortunately it didn't do anything for me.

ricovandevin’s picture

Adding

$conf['drupal_http_request_fails'] = FALSE;

to settings.php worked for me.

Thanks Thomas!

Rico Van de Vin
Finlet

rico@finlet.eu
https://www.finlet.eu
+31 085 0656 724

dropbydrop’s picture

Adding $conf['drupal_http_request_fails'] = FALSE; to settings.php worked for me too!

What is this settings means actually?
Does it have any negative side-effects?
Are we loosing something?

Why not putting it at default settings.php for drupal 7.9?

teh_catt’s picture

subscribing

onelittleant’s picture

We upgraded a D5 site with lots of contributed modules to D7. In the D7 site the admin/config configuration screen and the admin/reports/status status report screen were extremely slow to load, sometimes taking more than a minute. After much searching and very little luck, I found this post:

http://drupal.org/node/1081266

If you have upgraded to D7 and some modules that were previsouly available are no longer available, you will have entries in your system table that point to modules, themes or profiles that no longer exist. These missing files are the culprits! Here's some code that you can run via the Execute PHP block or in a custom module to find missing files. Uncomment the lines that delete the system entries if you want to clean things up. Our config screen load time went from over a minute to about a second!

$files = db_select('system', 's')
		->fields('s', array('filename', 'status'))
		->execute()
		->fetchAll();
	foreach($files as $obj) {
		if(!file_exists($obj->filename)) { 
			drupal_set_message(t('@fn is missing.  Status is @stat.', array('@fn' => $obj->filename, '@stat' => $obj->status)), 'error');
			// Uncomment the following 2 lines to delete missing files from the system table.  Backup your DB first!
			// db_delete('system')->condition('filename', $obj->filename, '=')->execute();
			// drupal_set_message(t('@fn deleted from system table', array('@fn' => $obj->filename)));
		}
	}
bxCreative’s picture

Wow - thank you! Such as easy fix :)

damien_vancouver’s picture

Thanks! Worked like a charm! You should turn it into a contrib module ;)

hkirsman’s picture

Although there's a module for this now - Module Missing Message Fixer - I borrowed your script for faster fix on my local development. If you don't mind then I would add 1 little fix for the module because even though I ran the script it still alerted me about the missing modules by Drupal. It seems Drupal needs clearing cache after this change.

$files = db_select('system', 's')
  ->fields('s', array('filename', 'status'))
  ->execute()
  ->fetchAll();

foreach ($files as $obj) {
  if (!file_exists($obj->filename)) {
    drupal_set_message(t('@fn is missing.  Status is @stat.', array('@fn' => $obj->filename, '@stat' => $obj->status)), 'warning');
    // Uncomment the following 2 lines to delete missing files from the system
    // table. Backup your DB first!
    db_delete('system')->condition('filename', $obj->filename, '=')->execute();
    drupal_set_message(t('@fn deleted from system table', array('@fn' => $obj->filename)));
  }
}

drupal_flush_all_caches();

Anybody trying this out then to execute this you do:

drush scr script-name.php
hkirsman’s picture

One more minor fix I'll add to the above code is changing drupal_set_message message type from error to warning. I was banging my head against the wall for a while because in my Lando configuration the script ran twice and and next scripts in the list didn't execute. I understood there must be some error code breaking it until figuring out it was the drupal_set_message status being too critical.

hkirsman’s picture

Added further fixes.

Made it more Drush friendly, no need to comment/uncomment to delete the files (rather it will ask and if you want to force then use "-y", fix a fatal error I had on my system. 

// Fix "Error: Uncaught Error: Call to undefined function cache_get()" error.
if (!function_exists('cache_get')) {
  return;
}

$files = db_select('system', 's')
  ->fields('s', array('filename', 'status'))
  ->execute()
  ->fetchAll();

$found_missing_files = FALSE;
foreach ($files as $obj) {
  if (!file_exists($obj->filename)) {
    $found_missing_files = TRUE;
    drush_print(t('@fn is missing. Status is @stat.', array('@fn' => $obj->filename, '@stat' => $obj->status)), 'warning');
  }
}

if ($found_missing_files === TRUE) {
  if (drush_confirm('Do you want to delete the missing files?')) {
    foreach ($files as $obj) {
      if (!file_exists($obj->filename)) {
        db_delete('system')->condition('filename', $obj->filename, '=')->execute();
        drush_print(t('@fn deleted from system table', array('@fn' => $obj->filename)));
      }
    }
    drush_print(t('Removed all missing files.'));

    drupal_flush_all_caches();
    drush_print(t('Cache cleared.'));
  }
  else {
    drush_user_abort();
  }
}