[ic] Eating up memory

Peter Jakl interchange-users@interchange.redhat.com
Fri Jan 11 18:32:01 2002


This is a multi-part message in MIME format.

------=_NextPart_000_004A_01C19AB4.DB7A7130
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Sorry to raise this issue again, but I don't know where else to go. I
have one catalog configured and launching the interchange server takes
about 3-1/2 minutes and allocates over 240MB (yes, megabytes) of memory.

I change interchange.cfg to load the construct demo and comment out my
live catalog and it loads fine. I tried Low and High Traffic settings
with no change.

How would I even go about debugging this?

I've attached my catalog.cfg and interchange.cfg in case someone can
spot something.

Peter


------=_NextPart_000_004A_01C19AB4.DB7A7130
Content-Type: application/octet-stream;
	name="interchange.cfg"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="interchange.cfg"

#Catalog       construct /var/lib/interchange/construct =
/cgi-bin/construct /construct
Catalog       page /var/lib/interchange/page /cgi-bin/page /page

# Set to 1 to include UI
Variable   UI   1

# Set to "low" or "high" to get different server parameters
Variable   TRAFFIC    low
#Variable   TRAFFIC    high

Environment  MOD_PERL

# Prevent arbitrary [file ...] and [include ...] among other things
NoAbsolute  Yes

#Uncomment to log to debug file /tmp/icdebug
#Variable   DEBUG     1

# You can set the Variable DEBUG above then tail -f the DebugFile
# You can also see Interchange and catalog data structures
#ifdef @DEBUG
Message Sending debug to /tmp/icdebug.
DebugFile /tmp/icdebug
GlobalSub sub test_global_sub { return 'Test of global subroutine OK.' }
Variable  TEST_VARIABLE Test of global variable OK.
#endif

#ifdef TRAFFIC =3D~ /low/i
Message Low traffic settings.
HouseKeeping 3
MaxServers   5
PIDcheck     300
#endif

#ifdef TRAFFIC =3D~ /high/i
Message High traffic settings.
HouseKeeping 2
MaxServers   10
PIDcheck     120
#endif

# No real downside to adding this....
Mall       Yes

# Additional Safe operations to untrap beyond the standard
# "ftfile sort"
SafeUntrap  rand

TcpMap 7786 -

# Uses value of UI variable above
#ifdef UI
Message Calling UI....
Variable UI_TAG_TITLE_BAR 1
#include lib/UI/ui.cfg
#endif

#### Now including individual usertag files

#include usertag/*


### Include if you want non-English error messages. Not complete.
# #include locale.error

------=_NextPart_000_004A_01C19AB4.DB7A7130
Content-Type: application/octet-stream;
	name="catalog.cfg"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="catalog.cfg"

# Set the sitewide information. The initial settings
# in the "variable" table are shown below; subsequent
# changes are only in the database, not below.

VariableDatabase variable

### These reflect the initial settings set above;
### if you uncomment them they will override it.
#
#Variable    SERVER_NAME     128.121.238.113
#Variable    CGI_URL         /cgi-bin/page
#Variable    SECURE_SERVER   http://128.121.238.113
#Variable    ORDERS_TO       peter@jakl.net
#Variable    IMAGE_DIR       /page/images
#Variable    DOCROOT         /var/www/html
#Variable    SAMPLEHTML      /var/www/html/page
#Variable    SAMPLEURL       http://128.121.238.113/page
#
#Variable    COMPANY         Page Computer
#Variable    ENCRYPTOR       none
#
#Variable    SOMESQL         1
#Variable    MYSQL           1
#Variable    PGSQL          =20
#Variable    ORACLE         =20
#Variable    SQLDSN          dbi:mysql:page
#Variable    SQLDB           page
#Variable    SQLUSER         interch
#Variable    SQLPASS         akop1a

## END SITE CONFIGURATION

ParseVariables  Yes

#########
######### Set the catalog URLS, using the Variable settings above.
#########
##
## The URLs which are written to call the CGI link script.
##=20
VendURL                 http://__SERVER_NAME____CGI_URL__
SecureURL               __SECURE_SERVER____CGI_URL__

## Set the image path for relative images
ImageDir                __IMAGE_DIR__/
ImageDirInternal        http://__SERVER_NAME____IMAGE_DIR__/

##
#########
#########=20
#########

#########
######### Some user session related settings...
#########
#
#

## Whether to encrypt passwords in UserDB
## We usually don't for users, so we can mail them their password
## We DO in admin, that is set in catalog_after.cfg
UserDB    default    crypt         0

## Change a field to something that doesn't conflict in MySQL
UserDB    default    time_field    mod_time

## Don't want people setting their credit limit or dealer status =
directly
UserDB    default    scratch       "dealer credit_limit"

### minimal login stuff for affiliate
UserDB    affiliate  user_field    affiliate
UserDB    affiliate  database      affiliate
UserDB    affiliate  time_field    none
UserDB    affiliate  crypt         0

## Set some initial values
ScratchDefault   mv_add_dot_html   1
ScratchDefault   mv_no_session_id  1
ScratchDefault   mv_no_count       1
ScratchDefault   order_style       1
ValuesDefault    mv_shipmode       upsg
ValuesDefault    show_basket       1
#
#
#########
#########
#########

################################################################
########   These define the variables for templating    ########
########   You see them in pages with __LEFTRIGHT_TOP__ ########
########                                                ########
########   Files are actually in templates/regions dir  ########
########                                                ########
################################################################

## Define some colors
##
Variable   HEADERBG    BGCOLOR=3D"#669999"
Variable   HEADERTEXT  #FFFFFF
Variable   TITLEBG     BGCOLOR=3D"#669999"
Variable   TITLETEXT   #FFFFFF

## Put in memory with high traffic settings
## Better performance this way
## TRAFFIC is defined in interchange.cfg
##
## Variables used in these files must have been previously defined

#ifdef @TRAFFIC =3D~ /high/i
ParseVariables  Yes
ConfigDir templates/regions
Variable      NOLEFT_TOP       <NOLEFT_TOP
Variable      NOLEFT_BOTTOM    <NOLEFT_BOTTOM
Variable      LEFTRIGHT_TOP    <LEFTRIGHT_TOP
Variable      LEFTRIGHT_BOTTOM <LEFTRIGHT_BOTTOM
Variable      LEFTRIGHT_TOP2    <LEFTRIGHT_TOP2
Variable      LEFTRIGHT_BOTTOM2 <LEFTRIGHT_BOTTOM2
Variable      LEFTONLY_TOP     <LEFTONLY_TOP
Variable      LEFTONLY_BOTTOM  <LEFTONLY_BOTTOM
Variable      LEFTONLY_BOTTOM2   <LEFTONLY_BOTTOM2
Variable      SEL_LEFT_TOP     <SEL_LEFT_TOP
Variable      SEL_LEFT_BOTTOM  <SEL_LEFT_BOTTOM
Variable      SEL_ALL_TOP      <SEL_ALL_TOP
Variable      SEL_ALL_BOTTOM   <SEL_ALL_BOTTOM
ConfigDir config
#endif

## Use [include ...] with low traffic settings, file read every time
## template changes show up immediately this way
## TRAFFIC is defined in interchange.cfg
##

#ifdef @TRAFFIC =3D~ /low/i
Variable      NOLEFT_TOP       [include templates/regions/NOLEFT_TOP]
Variable      NOLEFT_BOTTOM    [include templates/regions/NOLEFT_BOTTOM]
Variable      LEFTRIGHT_TOP    [include templates/regions/LEFTRIGHT_TOP]
Variable      LEFTRIGHT_BOTTOM [include =
templates/regions/LEFTRIGHT_BOTTOM]
Variable      LEFTRIGHT_TOP2    [include =
templates/regions/LEFTRIGHT_TOP2]
Variable      LEFTRIGHT_BOTTOM2 [include =
templates/regions/LEFTRIGHT_BOTTOM2]
Variable      LEFTONLY_TOP     [include templates/regions/LEFTONLY_TOP]
Variable      LEFTONLY_BOTTOM  [include =
templates/regions/LEFTONLY_BOTTOM]
Variable      LEFTONLY_BOTTOM2 [include =
templates/regions/LEFTONLY_BOTTOM2]
Variable      SEL_LEFT_TOP     [include templates/regions/SEL_LEFT_TOP]
Variable      SEL_LEFT_BOTTOM  [include =
templates/regions/SEL_LEFT_BOTTOM]
Variable      SEL_ALL_TOP      [include templates/regions/SEL_ALL_TOP]
Variable      SEL_ALL_BOTTOM   [include =
templates/regions/SEL_ALL_BOTTOM]
#endif

#
################################################################
################################################################

ParseVariables  Yes

# Sets Interchange to not parse <BODY MV=3D"body 1"> and other tags =
within
# HTML tags, use [pragma no_html_parse 0] to enable on a page
Pragma          no_html_parse

MailOrderTo             __ORDERS_TO__


################################################################
########   DATABASE SETUP                               ########
########                                                ########
########   When you defined your catalog, you specified ########
########   a database type. This region uses #include   ########
########   to include the database definitions based    ########
########   on that choice.                              ########
########                                                ########
########   See the directories in dbconf/ for the       ########
########   different types.                             ########
########                                                ########
################################################################
##
##

#ifndef SQLDSN
Variable    SQLDSN          dbi:mysql:page
#endif

#####
##### MySQL
#####
#ifdef MYSQL

Message Using MySQL, DSN=3D__SQLDSN__.

# Tell the default DBM we are using something else...
Variable  SOME_DATABASE  1

# Uncomment if needed
#Variable  SQLUSER  foo
#Variable  SQLPASS  bar

# The table defs are in separate files in the dbconf/mysql directory,
# the ones kept in DBM are in TABLENAME.dbm files.

#include dbconf/mysql/*

#endif

#####
##### PostgreSQL
#####
#ifdef PGSQL

Message Using PostgreSQL, DSN=3D__SQLDSN__.

# Tell the default DBM we are using something else...
Variable  SOME_DATABASE  1

# Uncomment and edit if needed
#Variable  SQLUSER  foo
#Variable  SQLPASS  bar

# The table defs are in separate files in the dbconf/pgsql directory,
# the ones kept in DBM are in TABLENAME.dbm files.

#include dbconf/pgsql/*

#endif

#####
##### Oracle
#####
#ifdef ORACLE

Message Using Oracle, DSN=3D__SQLDSN__.

# Tell the default DBM we are using something else...
Variable  SOME_DATABASE  1

# Oracle considers 'session', 'size', and 'comment' to be reserved
# words. Since we use those as column names, attach this arbitrary
# string to the end of each word to make it acceptable to Oracle.
# Note that this must be defined before the #include below.
Variable  FIELDMUNGE =20

# Uncomment and edit if needed
#Variable  SQLUSER  foo
#Variable  SQLPASS  bar

# The table defs are in separate files in the dbconf/oracle directory,
# the ones kept in DBM are in TABLENAME.dbm files.

#include dbconf/oracle/*

#endif

#####
##### Default DBM if nothing else defined
#####
#ifndef SOME_DATABASE

# The table defs are in separate files in the dbconf/dbm directory.

Message Using default DBM database.
#include dbconf/default_db/*

#endif

ProductFiles   products

##
##
################################################################
########                end database setup               #######
################################################################

AlwaysSecure         ord/checkout multi/checkout
AsciiTrack           logs/tracking.asc

################################################################
########                   Pricing setup                 #######
################################################################
########                                                 #######
########  In the construct demo, if the user is logged   #######
########  in and is marked as a "dealer" (1 in the       #######
########  dealer field in the userdb database) then      #######
########  they are given quantity discounts based on     #######
########  price groups. (All products except gift_cert   #######
########  are in price group 1 as distributed.) If       #######
########  the quantity is 1, then pricing comes from     #######
########  the "wholesale" field in the products          #######
########  database.                                      #######
########                                                 #######
########  If the user is not a dealer (or not logged in) #######
########  then pricing just comes from "price".          #######
########                                                 #######
########  There is an Autoload routine that determines   #######
########  the dealer status and changes the PriceField   #######
########  definition if they are.                        #######
########                                                 #######
########  The "gift_cert" AutoModifier allows special    #######
########  receipt, basket, and checkout display handling #######
########  for items defined as a gift_cert.              #######
########                                                 #######

PriceField     price

CommonAdjust   pricing:price_group,q5,q10: ;:wholesale ;$
AutoModifier   pricing:price_group
AutoModifier   products:gift_cert

UserDB         default    scratch    dealer

Autoload <<EOR
[perl]
    if($Scratch->{dealer}) {
            $Config->{PriceField} =3D 'no_price';
    }
[/perl]
EOR

########                                                 #######
################################################################

## Set this to No if you don't want auto-login capability for users
CookieLogin  Yes

# This sets up the new payment charge mode in Interchange 4
# You set it to "custom name", where name is the name of a GlobalSub
# that performs the charge operation. If it is not "custom", then
# it will use the CyberCash routines.
#
# "minivend_test" is special, and the demo order profile
# works with the demo order form to test
#
#Variable  MV_PAYMENT_MODE   minivend_test

# Uncomment to use creditCardAuto if you want, now handled better in
# order profiles with "&credit_card=3Dstandard".
#CreditCardAuto      Yes

# These are usually all you need for CyberCash 3
# Uncomment and edit to suit; make sure you remove CreditCardAuto =
somehow
#
#Variable         CYBER_CONFIGFILE    =
/home/you/yourid75/mck-cgi/merchant_conf
#Variable         CYBER_VERSION       3.2
#Variable         CYBER_MODE          mauthonly

#ifdef CYBER_MODE
Variable         MV_PAYMENT_MODE     mauthonly
CreditCardAuto   No
#endif

EncryptProgram   __ENCRYPTOR__

# Uncomment only if you have these locales on your system
#Locale          de_DE
#Locale          de_DE LC_CTYPE de_DE
#Locale          fr_FR
#Locale          en_US

Locale          en_US LC_CTYPE C
LocaleDatabase  locale

Onfly           onfly
OrderCounter    etc/order.number
OrderLineLimit  25
OrderProfile    etc/profiles.order etc/profiles.login etc/profiles.misc

# This makes CommonAdjust effective, since no_price doesn't exist
ReadPermission  group
RobotLimit       50

# Here we override Interchange's normal order routine
ActionMap  order   <<EOR
sub {
	#Log('in order action');
	if($CGI->{mv_nextpage} ne 'order') {
		# Do nothing
	}
	elsif($Values->{no_basket}) {
		$CGI->{mv_nextpage} =3D 'ord/nobasket';
	}
	else {
		$CGI->{mv_nextpage} =3D 'ord/basket';
	}
	$CGI->{mv_order_item} =3D $CGI->{mv_arg}
		if ! $CGI->{mv_order_item};
	$Tag->update('values');
	return 1;
}
EOR

ActionMap  deliver   <<EOR
sub {
	my $deliverable =3D shift;
	$Scratch->{deliverable} =3D $CGI->{mv_arg};
	$CGI->{mv_nextpage} =3D 'deliver';
	return 1;
}
EOR

ActionMap  get_password   <<EOR
sub {
	$Config->{NoSearch} =3D '';
	$CGI->{mv_nextpage} =3D $CGI->{mv_search_page} =3D =
'action/get_password';
	$CGI->{mv_todo} =3D 'search';
	$Tag->update('process');
	return;
}
EOR

ParseVariables Yes
Route log         attach          0
Route log         cybermode       ""
Route log         empty           1
Route log         encrypt         0
Route log         increment       0
Route log         report          etc/log_transaction
Route log         supplant        0
Route log         track           logs/log

Route log_entry   attach          0
Route log_entry   cybermode       ""
Route log_entry   empty           1
Route log_entry   encrypt         0
Route log_entry   increment       0
Route log_entry   report          etc/log_entry
Route log_entry   supplant        0
Route log_entry   track           logs/log

Route copy_user   attach          0
Route copy_user   cybermode       ""
Route copy_user   empty           1
Route copy_user   encrypt         0
Route copy_user   increment       0
Route copy_user   report          etc/mail_receipt
Route copy_user   supplant        0
Route copy_user   track           logs/log

# Main route must be last to make default
Route main        attach           0
Route main        credit_card      0
Route main        cybermode        ""
Route main        default          1
Route main        email            '__ORDERS_TO__'
Route main        encrypt          0
Route main        encrypt_program  '__ENCRYPTOR__'
Route main        errors_to        '__ORDERS_TO__'
Route main        increment        0
Route main        pgp_cc_key       ""
Route main        pgp_key          ""
Route main        receipt          etc/receipt.html
Route main        report           etc/report
Route main        supplant         1
Route main        individual_track orders
Route main        track            logs/tracking.asc

# Order routes can be maintained in a database, empty in demo
# CHANGES TO THIS WILL OVERRIDE THE ROUTES ABOVE
RouteDatabase    route

SalesTax         __TAXFIELD__
FractionalItems  Yes
SeparateItems    Yes

SpecialPage          catalog        index
SpecialPage          report         ../etc/report
SpecialPage          receipt        ../etc/receipt

NoCache              admin config multi ord query reconfig special

Static        __CATALOG_STATIC__
StaticLogged  __LOGGED_STATIC__
StaticAll     Yes
StaticDBM     static
StaticDepth   2
StaticDir     __SAMPLEHTML__/pages
StaticFly     Yes
StaticPath    __SAMPLEURL__/pages
TaxShipping   __TAXSHIPPING__

#ifdef UI_TRAFFIC_STATS
TrackFile __UI_TRAFFIC_STATS__
#endif

UpsZoneFile   products/zone8.csv
UseModifier   size color

History 10
UserTag history-scan Order find exclude default
UserTag history-scan addAttr
UserTag history-scan Routine <<EOR
my %var_exclude =3D ( qw/
	mv_credit_card_number 1
	mv_pc                 1
	mv_session_id         1
/);
sub {
	my ($find, $exclude, $default) =3D @_;
	my $ref =3D $Vend::Session->{History}
		or return $Tag->area($default || $Config->{SpecialPage}{catalog});
	my ($hist, $href, $cgi);
	$exclude =3D qr/$exclude/ if $exclude;
	for(my $i =3D $#$ref; $i >=3D 0; $i--) {
		#Log("checking $ref->[$i][0] for $exclude");
		if ($exclude and $ref->[$i][0] =3D~ $exclude) {
			next;
		}
		if($find) {
			next unless $ref->[$i][0] =3D~ /$find/;
		}
		($href, $cgi) =3D @{$ref->[$i]};
		last;
	}
	return $Tag->area($default || $Config->{SpecialPage}{catalog})
		if ! $href;
	my $form =3D '';
	for(grep !$var_exclude{$_}, keys %$cgi) {
		$form .=3D "\n$_=3D";
		$form .=3D join("\n$_=3D", split /\0/, $cgi->{$_});
	}
	return $Tag->area( { href =3D> $href, form =3D> $form} );
}
EOR

WritePermission group

# Here you can set up fatal errors if a necessary sub or usertag
# doesn't exist, uncomment one of next lines to test
#
#Require globalsub   nevairbe
#Require usertag   nevairbe

Require usertag   email
Require usertag   email_raw
Require usertag   var
Require usertag   loc
Require usertag   summary
Require usertag   button

------=_NextPart_000_004A_01C19AB4.DB7A7130--