[ic] Logging slow pages

Bill Carr bill at worldwideimpact.com
Tue Jun 13 22:20:37 EDT 2006

On Jun 13, 2006, at 9:55 AM, Stefan Hornburg (Racke) wrote:

> Bill Carr wrote:
>> On Jun 12, 2006, at 9:17 PM, Andrew Rich wrote:
>>> Hi Bill
>>> Just thought I would look at your webpage since you included the  
>>> link!
>>> When I went to products, then clicked on the click 'HERE' for
>>> 'Bottlenose
>>> Wine & Spirits Website' there was a problem with the next page.
>>> It appears the dot points under 'Included Site Features' have been
>>> truncated
>>> at the start.
>>> I am using IE6
>> Thanks. Will check it out. Damn IE ;-) I'm on a Mac.
>> And thanks to Racke for his tip. I did this:
>> AutoLoad <<EOA
>> [perl global=1]
>>     $Tmp->{StartTime} = time;
>> [/perl]
>> EOA
> Global is not necessary for that. If the code above doesn't work,  
> try $Tag->tmp();
I need global for 'time'. I thought it might not be necessary after I  
made my last post but I got the following when I took it away:
/var/log/interchange/debug.log.1:Safe: 'time' trapped by operation  
mask at (tag 'perl') line 2.

>> AutoEnd <<EOA
>> [perl global=1]
>>     use Data::Dumper;
>>     my $long_page_time = $Variable->{LONG_PAGE_TIME} || 5;
>>     my $page_time = time - $Tmp->{StartTime};
>>     if ($page_time >= $long_page_time) {
>>     ::logDebug(qq{Slow page: $Variable->{IC_CATALOG}/ 
>> $Global::Variable->
>> {MV_PAGE}, Time: $page_time, remote_host: $CGI::remote_addr, CGI:} .
>> Dumper($CGI));
>>     }
>> [/perl]
>> EOA
> Global is probably not necessary for that. Replace Dumper() with  
> uneval(),
> which is available in regular [perl] tag.
I did already replace Dumper with uneval (not as pretty though).  
Thanks. It's fun watching the slow pages add up.

I'm still having a tough time running in RPC mode. It will run along  
fine for hours and then the load average will shoot up to 10 or 15 on  
all or most of my IC servers. I do not see anything in the log files.  
I killall -9 interchange and restart and all is fine for a while. If  
I switch back to HIGH mode I don't see these problems but the  
response times are slower overall.

At one point we narrowed the problem down to a specific page. That  
page had a PERL block that counted hits from HTML broadcast e-mails  
and redirected to the desired link. In the block I had "use CGI;" and  
saw "Safe: Undefined subroutine CGI::delete" in the logs at the line  
where the "use CGI' was. An Internal Server error was presented to  
the client. When this problem came at all it came intermittently  
about once every 20 times. When I took out "use CGI" we could not  
reproduce the errors. I rewrote the page to not use "use CGI" and  
thought all of our problems were solved.  I just now tried to rewrite  
the page the old way but could not make the errors. I also could not  
create another test case to produce the errors with "use CGI'.

Bill Carr
Bottlenose - Wine & Spirits eBusiness Specialists
(877) 857-6700

More information about the interchange-users mailing list