Re: Limiting resources used by scripts on web server



On Jun 30, 8:48 am, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On Jun 30, 8:59 am, "graeme.piete...@xxxxxxxxx"

<graeme.piete...@xxxxxxxxx> wrote:

I had forgotten that TCLHttpd supports CGI, but it does rather negate
the advantages of using a server with TCL support.

If I understand the documentation, there are limits on time but on
memory. If I am wrong about it would solve the problem very nicely.

Well, you're asking too much I'm afraid. As soon as you insist on
servicing all requests from a single process (which is what you're
doing by rejecting CGI), pre-request memory accounting becomes
extremely hard.

What I meant by that is that if I use CGI I might as well use Apache
as TclHttpd.

If I do use Apache then I might as well use FastCGI or an Apache
module like Websh rather than CGI.

More precisely, accounting by the OS becomes impossible (since the
heap is shared among all threads of a process), so must be done at the
application level. And when the application is Tcl, it turns out it is
hard because (1) Tcl_Objs are allocated globally, and not bound to a
thread/interp, (2) to my knowledge there is no instrumentation to keep
track of how many Tcl_Objs were created by a given thread/interp.

I had a vague idea it was difficult, but your explanation makes it
clearer. Thanks.


Advice: if you're worried by memory consumption of a single request,
my bet is that the granularity will be large enough for CGI to be an
acceptable vehicle. And it will give you 'ulimit' for free.
.



Relevant Pages

  • Re: Limiting resources used by scripts on web server
    ... I had forgotten that TCLHttpd supports CGI, ... the advantages of using a server with TCL support. ... doing by rejecting CGI), pre-request memory accounting becomes ... track of how many Tcl_Objs were created by a given thread/interp. ...
    (comp.lang.tcl)
  • Re: Perl code shows high usage in "top" - why?
    ... Yet, as I monitor my server CPU and memory usage, top shows this as ... my $cgi = new CGI; ... print JF1 qq; ...
    (perl.beginners)
  • Re: Memory problem
    ... I see that it really does return memory back to ... Does that work for any other platforms? ... Tcl Support and Productivity Solutions ...
    (comp.lang.tcl)
  • force it to use more memory
    ... Most activity is generated by cgi scripts which run "real" ... The "mode" of action is that script ... But the system uses only small amount of memory ... ... However when I make installtion I can see with iostat that ...
    (SunManagers)
  • Re: web hoster wont secure CGI
    ... > capabilities to limit user processes in various which, if employed, would ... > be just as effective against mult-megabyte uploads as the changes to CGI ... locked memory, maximum memory size, opened files, cpu time, maximum user ...
    (comp.lang.perl.misc)