Re: Performance: .mt scripts accessing data outside script

2001-10-13 Thread Geoff Canyon

At 7:39 PM -1000 10/12/01, Sivakatirswami wrote:
2) In terms of speed: We have three options for containers I can use to
store the needed data for the different responses and email text that have
to be sent out... which of these three will be fastest? I am trying to save
some dozen hours of testing if some wizard out there already knows the
answer:

 a) as functions at the end of the script,

snip

  b) read single small text files from disk as needed... I am already
doing this from some purposes and it seems quite fast...

snip 
 
c) for organization purposes and maintenance it would be very cool
 to create a stack and have all the data needed in the stack in
different cards/fields then just upload this stack to the site along side
the .mt script. This way you have only to maintain, FTP, upload download a

Does the script have persistence? If it does I would think the fastest way would be an 
associative array. In the setup, you could read in the text files, something like:

put url file:canadaEmail.txt into theEmailReply[canada]

etc.

Then your script could simply use theEmailReply[canada]

But if the script is triggered anew each time, that wouldn't be the way to go.

regards,

Geoff

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Performance: .mt scripts accessing data outside script

2001-10-13 Thread Sivakatirswami

on 10/13/01 2:00 PM, Geoff Canyon  at [EMAIL PROTECTED] wrote:

 b) have the .mt script read single small text files from disk as needed...
I am already
 doing this from some purposes and it seems quite fast...
 
 snip 
 
c) for organization purposes and maintenance it would be very cool
 to create a stack and have all the data needed in the stack in
 different cards/fields then just upload this stack to the site along side
 the .mt script. This way you have only to maintain, FTP, upload download a
Geoff:  
 Does the script have persistence? If it does I would think the fastest way
 would be an associative array. In the setup, you could read in the text files,
 something like:
 
 put url file:canadaEmail.txt into theEmailReply[canada]
 
 etc.
 
 Then your script could simply use theEmailReply[canada]
 
 But if the script is triggered anew each time, that wouldn't be the way to go.

No, the script is not persistent... it is called each time a submit from the
web form is sent from a browser.

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org

Statement on America Under Attack

And 

August 2000 Address made at the United Nations
on Stopping the War in the Home:

http://www.saivasiddhanta.org/hawaii/church/policy/attack_on_america_9112001
.html



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Performance: .mt scripts accessing data outside script

2001-10-12 Thread Sivakatirswami

I am working on a conversion of a PERL script called BFormMail.pl which
parses incoming data from a web guestbook form, stores it to a file and
sends an response back to the client. This is a .mt script on a Sun Solaris
machine in Honolulu running Apache.

My implementation will involve an additional layer which checks the
country the user is from and will a) respond with a country specific thank
you acknowledgement.html page and b) send an email back to that person with
country specific details for further contact and also c) send the email
address of the person to auto subscribe him to email list serves...

Given that even the current PERL script seems to fail on concurrent hits
(my data file will show that the data from client A form submission is cut
in half and the latter half of that entry will be from client B... e.g.

Anand Rajan  230 Maple Road, Houston  Hertforshire EB2 3N8 ENGLAND

tells me that the latter half of the Anand's address is gone and the first
half of the address of person in England is also gone... One surmises the
two file writes collided somehow... rarely, but about once a month two
addresses get lost like this.

And, given that I am going to be asking the script to do even more than the
PERL script did, with any single submission... I am now wondering about
similar performance issues with a .mt script...and have two basic questions
to be answered in terms of performance and speed:

1) Is there a way to manage concurrent hits so as to preserve the integrity
of the data submitted from both? I'll be using a put data after url
file:whatever.txt for a file that will reside in the same cgi-bin as the
.mt script.  I suppose this would also be an Apache issue in terms of how it
buffers concurrent inputs to stnin... in relation to how MC will handle that
buffer...but if there is something the script can do to protect the data in
the process, what would it be?

2) In terms of speed: We have three options for containers I can use to
store the needed data for the different responses and email text that have
to be sent out... which of these three will be fastest? I am trying to save
some dozen hours of testing if some wizard out there already knows the
answer:
 a) as functions at the end of the script,
 function emailResponse theCountry
   switch theCountry
 case ENGLAND
  put  #the all the text or an email here to be returned
by this function# into theEmailReply
return theEmailReply
etc.
i.e. all the text of the emails and *.html acknowledgements reside right in
the .mt script itself, being called as functions. Makes for a long an
bloated script (which is  strategy of formMail.pl which contains in the
script itself the html it needs for some response pages)


  b) read single small text files from disk as needed... I am already
doing this from some purposes and it seems quite fast...

case Canada
  put url file:canadaEmail.txt into theEmailReply
  return theEmailReply

etc. 
  
c) for organization purposes and maintenance it would be very cool
 to create a stack and have all the data needed in the stack in
different cards/fields then just upload this stack to the site along side
the .mt script. This way you have only to maintain, FTP, upload download a
single data object. In this case the main .mt script would have to make
requests like this (I've never done this before in a non GUI context...so
just guessing) 

 case CANADA
 put fld email of card CANADA of \
stack guestResponseData.mc into theEmailreply

put fld html of card CANADA of \
stack guestResponseData.mc into theHTMLthankYou

etc. 

[side question: in such a non GUI context, do you have to open the stack
first?]

which of the above three kinds of containers will be fastest? Any insights?

Thank you!

Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.