Server.php bootstrap booting drupal once for every block on the page.

Will Kirchheimer - May 7, 2008 - 06:34
Project:Advertisement
Version:5.x-1.4-1
Component:ad module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

This should probably be associated with component server.php but I didn't see an option.

So, I was looking at speed analysis of my site, and I noticed server.php was being repeatedly called, and taking longer to execute than drupal itself. Heading into the code I found that this item was bootstrap booting drupal for each block that has an add in it.

That seems wrong?

This means on my site with 5 ad areas, I am booting drupal 6 times?

Any thoughts about that, is there a way around this? Is it not as bad as I think?

Thanks

#1

Jeremy@kerneltr... - May 7, 2008 - 13:16
Title:Server.php bootscrap booting drupal once for every block on the page.» Server.php bootstrap booting drupal once for every block on the page.
Status:active» fixed

That is what the cache modules are for. You can use the file cache or the memcache cache to avoid bootstrapping drupal each time an advertisement is served.

#2

Will Kirchheimer - May 18, 2008 - 19:41
Status:fixed» active

I am finding that caching is not really speeding things up as much as I would assume intended.

Have tried a few different cache settings, and in general the loading of the ad files always takes longer than the actual execution of the drupal index.php file.

Could some folks try out their tools.pingdom.com against their ads and sites and give some feedback as to their root files versus ad files load times?

Thanks

#3

Jeremy@kerneltr... - May 20, 2008 - 14:05
Status:active» active (needs more info)

Please follow the directions in DEBUG.txt, I'm guessing your file cache isn't actually running, perhaps due to file permissions.

#4

Will Kirchheimer - May 20, 2008 - 20:34

Sorry for changing the name of the domain in the stats below, , we are still in dev, and I can't release it.

Also, my request is still out there that folks maybe check their sites using pingdom and let me know if they are or aren't receiving similar results.

Thank you for your time.

Debug info:

Attempting to include cache include file '/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html/sites/all/modules/ad/cache/file/ad_cache_file.inc'.
ad_dir: '/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html/sites/all/modules/ad'
debug: '2'
cache: 'file'
nids: ''
tids: '153'
hostid: ''
quantity: '1'
aid: '0'
method: 'javascript'
path: 'files'
files: '15'
Root drupal directory detected as '/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html'.

/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html/sites/all/modules/ad/serve.php: // $Id: serve.php,v 1.1.2.2 2007/10/19 02:46:40 jeremy Exp $
/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html/sites/all/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.59 2008/01/11 19:37:33 jeremy Exp $

Using file cache.
Trying cache_file '/nfs/c02/h05/mnt/40480/domains/dev2.XXXtesting_domainXXX.org/html/files/.1.ad.cache'.
Obtained lock.
File size: 5783
Last sync: 1211311519
Current time: 1211311920
Will rebuild cache in 199 seconds.
Timestamp: 2008052012
cache_size(3)
Size of $ids: 0
Selecting 1 ad(s) from 3 total ad(s).
Randomly selecting ad: 1 of 1.
Randomly selected ID: 37209.
Displaying AID: 37209
document.write('\x3cdiv class=\"image-advertisement\" id=\"ad-37209\"\x3e\x3ca href=\"http://dev2.XXXtesting_domainXXX.org/ad/redirect/37209/\" title=\"\" target=\"_blank\"\x3e\x3cimg src=\"http://dev2.XXXtesting_domainXXX.org/files/furniture.jpg\" width=\"200\" height=\"115\" /\x3e\x3c/a\x3e\x3c/div\x3e');

#5

Will Kirchheimer - May 20, 2008 - 21:06

Ok, so the problem appears to be the ampersands:

This is extremely slow, and appears to not cause the cache to be loaded
http://dev2.***domain***.org/sites/all/modules/ad/serve.php?q=1&amp,c=fi...

This is very fast, and appears to be loading the cache
http://dev2.***domain***.org/sites/all/modules/ad/serve.php?q=1&c=file&f...

Anyone thoughts on that off hand? otherwise I will start going through the code and see if I can locate the &amp, generating code.

#6

Will Kirchheimer - May 20, 2008 - 23:49

Contrary to my understanding of the internet and of course drupal I modified ad.module core to remove &amp, and the cache files are now being accessed and the whole thing is blazing fast.

So, I assume (and my css/compliance/layout partner assumes) that we shouldn't be having this problem. I figure it is an environmental issues with my server? Shall post more when I figure out more.

Drupal 5.7
Host: Media Temple (GS)
Domain type: Alias domain (sadly these usually run a little weird)
PHP: 5.2 (or something close)

And there is this in php.ini:
cgi.fix_pathinfo=1

Thanks for your time

#7

Jeremy@kerneltr... - May 21, 2008 - 02:52

When collecting debug, you have to convert the &'s to &'s, as described in DEBUG.txt -- but based on your debug output you already did this? Or you've hard coded configuration values in settings.php? The output you provided was clearly collected using the file cache -- offhand I can think of no reason why it would load slowly, but I assure you when working properly it is very significantly faster than bootstrapping Drupal.

What OS are you using?

#8

Jeremy@kerneltr... - August 9, 2008 - 22:24
Status:active (needs more info)» fixed

No response in months, closing.

#9

Anonymous (not verified) - August 23, 2008 - 22:33
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.