[naviserver-devel] better ns_cache statistics

2006-02-07 Thread Gustaf Neumann

Hi there,

determining a good cache size and useful time-out-values is a 
non-trivial task.
ns_cache_stats returns already some useful satistics, but i would say, 
at least two
important figures are missing, which are subsumed by the # of flushes. 
Actually,

there are at least 3 kind of flushes:
 a) expires  (entry is too old)
 b) prunes  (entry thrown out of the cache due to space competition)
 c) intentional flushes (flush command, deletion of an entry, etc.)

Currently, nscache lumbs a+b+c under flushes. It would be nice
to obtain separate values for these kinds of flushes to get some
idea, whether or not a cache behaves like expected, or whether it
should be increased or decreased.

what do you think?

-gustaf



Re: [naviserver-devel] standardized comparisons

2006-02-07 Thread Gustaf Neumann

Bernd Eidenschink schrieb:

Gustaf,

I started with these:

* tcl/form.tcl:
* tcl/http.tcl:
* tcl/charsets.tcl:
* tcl/fastpath.tcl:
* tcl/sendmail.tcl:

the other files you provided partially differ from HEAD. I'll work over them 
the next days.


  
here they are. i made a cvs update + make install, but went to the old 
directory structure.
now they are supposed to be correct. i went as well over today's version 
of ttrace
(zoran, minor stuff; if you don't like the changes feel free to 
disregard it. most of the
changes is using "eq" instead of "==" for alphanum equality. "==" tries 
first to convert

the string to a number, so "eq" and "ne" are the correct checks).

all the best
-gustaf



ns-modules-tcl.tar.gz
Description: GNU Zip compressed data


Re: [naviserver-devel] standarddized comparions

2006-02-07 Thread Gustaf Neumann

Bernd Eidenschink schrieb:


Gustaf,

I started with these:

   * tcl/form.tcl:
   * tcl/http.tcl:
   * tcl/charsets.tcl:
   * tcl/fastpath.tcl:
   * tcl/sendmail.tcl:

the other files you provided partially differ from HEAD. I'll work over them 
the next days.
 

really? i did a cvs update before i worked over these... i'll check 
later, when i am back home.

-gustaf





Re: [naviserver-devel] standarddized comparions

2006-02-07 Thread Bernd Eidenschink
Gustaf,

I started with these:

* tcl/form.tcl:
* tcl/http.tcl:
* tcl/charsets.tcl:
* tcl/fastpath.tcl:
* tcl/sendmail.tcl:

the other files you provided partially differ from HEAD. I'll work over them 
the next days.

-Bernd.



Re: [naviserver-devel] standarddized comparions

2006-02-07 Thread Bernd Eidenschink
> Here comes something to consider for the distro:
>
> the .tcl files contain still many legacy comparions and some non-braced
> expressions.
> attached are the updated files that standardize the comparisons and can
> be compiled
> into more effficient byte-code.

that's really true. i'll go and include them one by one.

Thanks!

Bernd.



[naviserver-devel] standarddized comparions

2006-02-07 Thread Gustaf Neumann

Here comes something to consider for the distro:

the .tcl files contain still many legacy comparions and some non-braced 
expressions.
attached are the updated files that standardize the comparisons and can 
be compiled

into more effficient byte-code.

best regards
-gustaf




ns-modules-tcl.tar.gz
Description: GNU Zip compressed data


[naviserver-devel] Runtime directory layout?

2006-02-07 Thread Zoran Vasiljevic

Hi !

I wonder why is this so:

bash-2.03$ find modules/tcl/
modules/tcl/
modules/tcl/nsperm
modules/tcl/nsperm/init.tcl
modules/tcl/nsperm/compat.tcl
modules/tcl/charsets.tcl
modules/tcl/compat.tcl
modules/tcl/debug.tcl
modules/tcl/fastpath.tcl
modules/tcl/file.tcl
modules/tcl/form.tcl
modules/tcl/http.tcl
modules/tcl/init.tcl
modules/tcl/prodebug.tcl
modules/tcl/sendmail.tcl
modules/tcl/stats.tcl
modules/tcl/util.tcl
modules/tcl/nsdb
modules/tcl/nsdb/util.tcl

bash-2.03$ find tcl
tcl
tcl/nsperm
tcl/nsperm/init.tcl
tcl/nsperm/compat.tcl
tcl/cache.tcl
tcl/charsets.tcl
tcl/compat.tcl
tcl/debug.tcl
tcl/fastpath.tcl
tcl/file.tcl
tcl/form.tcl
tcl/http.tcl
tcl/init.tcl
tcl/prodebug.tcl
tcl/sendmail.tcl
tcl/stats.tcl
tcl/ttrace.tcl
tcl/util.tcl
tcl/nsdb
tcl/nsdb/util.tcl


IOW, why is the private library for the virtual server
seeded with the same files as the shared library?
Isn't it supposed that private virtual server Tcl lib
should actually override files in the shared lib and
not duplicate them?

Cheers,
Zoran



Re: [naviserver-devel] included ttrace

2006-02-07 Thread Zoran Vasiljevic

Am 07.02.2006 um 05:34 schrieb Stephen Deasey:





Can this be changed to:

ns_section ns/server/$servername/tcl
ns_parambetternamehere  true

It's clearly part of the Tcl configuration.  As for the name, 'trace'
just seems too generic, which is why it clashes with existing usage
(ns_register_trace).

Anyway, tracing is just the mechanism, not the purpose.  What about
lazyloader, or tclondemand, or ...?


Well, anything you wish. We can call it lazyloader, for example.





This way all "things" loaded into an interp during startup
will just be recorded in ttrace database. At new thread
creation, a short bootstrap script will be installed
instead of a full-blown (potentially very large) init
script. This one overrides the Tcl unknown method and loads
required "things" definitions on-demand.



Why is this off by default?  This is robust, right?


This is very robust for us as we have been using it for
some years already. I have two other OACS sites (not ours)
which uses it as well. It is per-default off because I
did not want to throw some foreign code to you before you
have the chance to test it. After everybody is satisfied
we can scrap quite a bit from bin/init.tcl.



How about some debug log statements, so that we can see that it's
working correctly.


This is true. I will add this.



Looks like some cut 'n paste cleanup is needed:  The blurb at the top
of ttrace.tcl mentions licence.terms.  You'll need to include the
license directly at the top of the file.  nsv_*, ns_mutex etc. will
always be available as this is now embedded in NaviServer -- can you
remove the indirect calls ( ${store}set etc. ) ?


Yes. The thing is also the part of the Tcl threading extension,
hence I made it generic. I can remove those compat code as it
will be easier to read. But, I did not want to introduce some
errors before you get the chance to give it a try. Once blessed
we can make all those things above and make it on per default.

Cheers
Zoran