Closed (fixed)
Project:
Advertisement
Version:
5.x-1.4-1
Component:
ad module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2008 at 06:34 UTC
Updated:
23 Aug 2008 at 22:33 UTC
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
Comments
Comment #1
jeremy commentedThat 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.
Comment #2
will kirchheimerI 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
Comment #3
jeremy commentedPlease follow the directions in DEBUG.txt, I'm guessing your file cache isn't actually running, perhaps due to file permissions.
Comment #4
will kirchheimerSorry 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');
Comment #5
will kirchheimerOk, 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&,c=file&,f=15&,p=files&,t=153
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=15&p=files&t=153
Anyone thoughts on that off hand? otherwise I will start going through the code and see if I can locate the &, generating code.
Comment #6
will kirchheimerContrary to my understanding of the internet and of course drupal I modified ad.module core to remove &, 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
Comment #7
jeremy commentedWhen 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?
Comment #8
jeremy commentedNo response in months, closing.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.