slow CGI with open socket

LiangTyan Fui mlist at afteroffice.com
Mon Mar 25 02:26:01 EST 2002


OK list, here is a problem that I have no answer for the last 2 days.
I am working on Linux based MetaCard CGI, everything went smoothly by far
except when I was trying to use "open socket".
When a "open socket" command is used, the script took unreadably longer time
to exit, even without any problem. I've tried to run the script under Apache
as CGI and directly from the shell, both yield the same result.

You may cut the following script and save it as your .mt file in your server
to tryout. Remember to modify the first line of the script to your real MC
runtime engine.

Thanks.

------------ script start ---------
#!/home/mc/mc

on startup
  # any local http server will do, if you have one
  put "www.yahoo.com:80" into thesock
  
  put the long ticks into startTicks
  open socket thesock
  close socket thesock
  put the long ticks - startTicks into ticksTaken
  
  put "Content-Type: text/plain"& crlf & crlf
  put "Ticks taken for this CGI to excute: "& ticksTaken
end startup
------------ script end ---------




More information about the metacard mailing list