[Metacard] Re: Open Stack With CGI on UNIX Server?

Pierre Sahores psahores at easynet.fr
Sat Nov 24 19:05:02 EST 2001


Sivakatirswami a écrit :
> 
> I am considering the option of storing HTML template data and code chunks in
> a MC stack on a server and running MC .cgi scripts to tell Apache to get
> that data, build pages and serve the HTML... Since I don't know PHP, PERL,
> ASP and really have no intention/time to learn them... xTalk is pretty much
> my only option (and also, the "easier way to do that")  We asked this
> before, but didn't get much feedback... maybe no one is doing it?
> 
> Options are:
> 
> a) store the code in fields of the stack and call the fields
>       (easier to manage)
> b) store the code in customProperties of a stack and get the properties
> 
> c) store code in small text files... (gets back to reading everything from
> disk each time)
> 
> Using a script like this:
> 
> on startup
>    open stack "../htmlDataBase/templateData.mc
>  ## extract the data, build the page(s), email(s)
>  ## serve the page (s); send the email(s)
> end startUp
> 
> Questions arise:
> 
> 1) Does the "open stack" syntax "mean" anything in the no console mode of
> MC? i.e. is the stack actually opened and loaded into the RAM of the host
> server by the mc.cgi/apache, thereby making the custom properties
> "instantly" available as opposed to reading text files from disk? i.e. there
> would be a single file read, and the rest done in memory?
> 
> or if the "open Stack" syntax doesn't really load the stack into the HOST
> ram...then I guess it means each call for field or custom property data is
> in fact a disk read...
> 
> Which is it?
> 
> 2) Is there an I/O issue for multiple, near simultaneous hits to the CGI,
> where the data for two simultaneous hits on the same CGI asking for data
> from a single stack could be a problem?
> 
> I am no so much worried about time to serve the pages [as far as I can see
> .asp and java scripts that serve HTML pages from databases are already
> painfully slow and MC I expect will easily outperform them...]
> 
> The underlying, unresolved, bigger question/worry is, obviously... how to
> optimize so that multiple simultaneous hits during peak access period don't
> cause Apache to error out? And, would it be better to have all the code be
> simple, separate text files--painful to manage, but perhaps easier for the
> I/O routines of the server? anyone have experience in this area?
> 
> Hinduism Today
> 
> Sivakatirswami
> Editor's Assistant/Production Manager
> katir at hindu.org
> www.HinduismToday.com, www.HimalayanAcademy.com,
> www.Gurudeva.org, www.hindu.org
> 
> Read The Master Course Lesson of the Day at
> http://www.gurudeva.org/lesson.shtml
> 
> Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <bugs at metacard.com>, not this list.


Hi Sivakatirswami,

All you need to get the rights answers is to learn how to get mc stacks
running as long processes in console mode. As it runs fine under Linux,
it must run under Solaris8 too without problems.

If you choose to use an MC long running process stack to serve datas to
the web trough Apache, you will never got errors as long as you will use
a non metatalk stuff (script or long process) to link Apache and your
web mc stack together, trough a TCP/IP socket. You will there need to
use a small 20 lines script, written in Perl, Python or as me, in PHP.

If interested, just see about the subject what i wrote times ago in the
mc archives at
<metacard at lists.best.com> or <metacard at lists.runrev.com>.

Too be sure, you can handle stacks as long processes in console mode,
just use this (right running under Linux, not tested under Solaris8 x86
for yet) :

> Pierre Sahores wrote:
> > 
> > Just alike you start other console apps from the bash prompt. To test
> > this, just launch, from the shell, a new "test.mc" stack that only
> > contains :
> > 
> > on openstack
> > put "Hello World"
> > end openstack
> > 
> > in typing "/home/pierre/startmc &" at the prompt where startmc, set
> > with an executable permission, contains :
> > 
> > #!/home/pierre/mc
> > on startup
> >  open stack "/home/pierre/test.mc"
> > end startup
> > 
> > If all is right done, you will see the "Hello World" ansered at
> > prompt... and, in opening "KSysGuard", you will see the "startmc" line
> > entry, as a still running process...
> > 
> > > doesn't it need X?
> > 
> > No. You need just an rc.d (level 3) bash starter script pointing to the
> > stack you want to launch in the background (see the list archives). The
> > only metatalk feature unavailable in console mode is the "idle"
> > function. Is'n it great (Thanks again and again, Scott...) ?
> > 
> This is really nice, thanks for the tip.
> > 
> > Have fun, Pierre Sahores
> > 
> > WEB & VPN applications & databases servers
> > Inspection académique de Seine-Saint-Denis
> > Qualifier & produire l'avantage compétitif
> Andu

-- 
Best Regards, Pierre Sahores

WEB & VPN applications & databases servers
Inspection académique de Seine-Saint-Denis
Qualifier & produire l'avantage compétitif




More information about the metacard mailing list