From: Vlad S. <vl...@cr...> - 2007-08-10 20:29:44
|
For example instead of this (or it could be used at the same time, it is not a replacement) ns_section "ns/fastpath" ns_param cache false ns_param cachemaxsize 5120000 ns_param cachemaxentry 512000 ns_param mmap false it may look like this (still Tcl) section "fastpath" { cache false cachemaxsize 5120000 cachemaxentry 512000 mmap false } section "server/${servername}" { connsperthread 0 flushcontent false maxconnections 100 maxthreads 10 minthreads 0 threadtimeout 120 } As you can see this is Tcl command section proc section { name args } { ns_section ns/$name foreach { key val } $args { ns_param $key $val } } But config looks like more 21 century and more structured and easier to read. Very similar to lighttpd by the way. -- Vlad Seryakov vl...@cr... http://www.crystalballinc.com/vlad/ |
From: Vlad S. <vl...@cr...> - 2007-08-10 20:38:57
|
Also if section command be made recursive-aware, so it will track current position then the syntax can be event more eaiser section "server/$servername" { connsperthread 0 flushcontent false maxconnections 100 maxthreads 10 minthreads 0 threadtimeout 120 section "modules" { nsdb nsdb.so nssock nssock.so } section "adp" { map "/*.adp" enableexpire false } section "tcl" { nsvbuckets 16 library ${homedir}/modules/tcl lazyloader false } section "module/nssock" { port $port address $address } } Vlad Seryakov wrote: > For example instead of this (or it could be used at the same time, it is > not a replacement) > > ns_section "ns/fastpath" > ns_param cache false > ns_param cachemaxsize 5120000 > ns_param cachemaxentry 512000 > ns_param mmap false > > it may look like this (still Tcl) > > section "fastpath" { > cache false > cachemaxsize 5120000 > cachemaxentry 512000 > mmap false > } > > section "server/${servername}" { > connsperthread 0 > flushcontent false > maxconnections 100 > maxthreads 10 > minthreads 0 > threadtimeout 120 > } > > > As you can see this is Tcl command section > > proc section { name args } { > > ns_section ns/$name > foreach { key val } $args { > ns_param $key $val > } > } > > But config looks like more 21 century and more structured and easier to > read. Very similar to lighttpd by the way. > > -- Vlad Seryakov vl...@cr... http://www.crystalballinc.com/vlad/ |
From: Jeff R. <dv...@di...> - 2007-08-10 21:41:27
|
Vlad Seryakov wrote: I like the general look and that it can be implemented in pure tcl (heck, even by just sourcing the implementation at the top of your current config). > it may look like this (still Tcl) > > section "fastpath" { > cache false > cachemaxsize 5120000 > cachemaxentry 512000 > mmap false > } > > section "server/${servername}" { > connsperthread 0 > flushcontent false > maxconnections 100 > maxthreads 10 > minthreads 0 > threadtimeout 120 > } Alot of the section names are heirarchical too so could this concept be taken further? e.g., server "server1" { directoryfile index.html pageroot /root section "tcl" { library /root/server1/lib/tcl } section "modules" { nslog ${bindir}/nslog.so } } > As you can see this is Tcl command section > > proc section { name args } { > > ns_section ns/$name > foreach { key val } $args { > ns_param $key $val > } > } It would need to be uplevel-ed if variable expansion is to take place but that's pretty minor. -J > > But config looks like more 21 century and more structured and easier to > read. Very similar to lighttpd by the way. > > |
From: Vlad S. <vl...@cr...> - 2007-08-10 21:50:02
|
By implementing it in C and using Tcl_Eval ascripts will be executed at global level and all variables will be visible. It is just may result in supporting 2 diferent config styles which may add maintanence and confusion but overall i personally like new style better Jeff Rogers wrote: > Vlad Seryakov wrote: > > I like the general look and that it can be implemented in pure tcl > (heck, even by just sourcing the implementation at the top of your > current config). > >> it may look like this (still Tcl) >> >> section "fastpath" { >> cache false >> cachemaxsize 5120000 >> cachemaxentry 512000 >> mmap false >> } >> >> section "server/${servername}" { >> connsperthread 0 >> flushcontent false >> maxconnections 100 >> maxthreads 10 >> minthreads 0 >> threadtimeout 120 >> } > > Alot of the section names are heirarchical too so could this concept be > taken further? e.g., > > server "server1" { > directoryfile index.html > pageroot /root > section "tcl" { > library /root/server1/lib/tcl > } > section "modules" { > nslog ${bindir}/nslog.so > } > } > > > >> As you can see this is Tcl command section >> >> proc section { name args } { >> >> ns_section ns/$name >> foreach { key val } $args { >> ns_param $key $val >> } >> } > > It would need to be uplevel-ed if variable expansion is to take place > but that's pretty minor. > > -J > >> But config looks like more 21 century and more structured and easier to >> read. Very similar to lighttpd by the way. >> >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Stephen D. <sd...@gm...> - 2007-08-11 13:14:58
|
On 8/10/07, Vlad Seryakov <vl...@cr...> wrote: > > section "fastpath" { > cache false > cachemaxsize 5120000 > cachemaxentry 512000 > mmap false > } One problem with this is you can't add comments: section fastpath { cache false ;# Turn off caching ... } With the recursive version, you can't add full line comments to sections. You could switch to a real parser, but then you loose the simplicity of using pure Tcl, which is kind of the appeal. On 8/10/07, Brett Schwarz <bre...@ya...> wrote: > > namespace eval fastpath { > set cache false > set cachemaxsize 5120000 > set cachemaxentry 512000 > set mmap false > } This solves the problem of comments by making the body eval'able and using the set command. But it breaks duplicate values: ns_section "ns/server/${servername}/adp" ns_param map "/*.adp" ns_param map "/*.u_adp" ns_param map "/*.gb_adp" ns_param map "/*.sjis_adp" On 8/10/07, Jeff Rogers <dv...@di...> wrote: > > I like the general look and that it can be implemented in pure tcl > (heck, even by just sourcing the implementation at the top of your > current config). I think this nails it. The benefit of the Tcl config file is that you make it do whatever you want. In this case, with 5 lines of code. Isn't this validation that the current scheme is working well and this is all that's needed? I've started a new wiki page to gather config file tricks 'n tips: http://naviserver.sourceforge.net/wiki/index.php/Tcl_Configuration_File (btw. I updated the wiki software and SF updated their servers. Seems pretty responsive.) |
From: Zoran V. <zv...@ar...> - 2007-08-11 13:26:51
|
Am 11.08.2007 um 15:15 schrieb Stephen Deasey: > One problem with this is you can't add comments: > > section fastpath { > cache false ;# Turn off caching > ... > } Well, you could be overriding the [unknown] and eval'in the whole block. This would implicitly mean that you should not have config option named after any built-in Tcl command, yes. Altogether, I do not know if this all is worth the trouble. It looks nicer, true. But is it worth it? Cheers Zoran |
From: Zoran V. <zv...@ar...> - 2007-08-11 14:01:38
|
Am 11.08.2007 um 15:26 schrieb Zoran Vasiljevic: > This would implicitly > mean that you should not have config option named > after any built-in Tcl command, yes. One can create a virgin interp and then scratch all commands from it and just define the [unknown]. I've never done that but in theory, this could work. |
From: Vlad S. <vl...@cr...> - 2007-08-11 17:48:29
|
If the only problem is comments that can be done easy. Benefit to make config easier, if you check mailing list NS/As, most question are related to configuration, for web admins who is not familiar with Tcl this is a showstopper, plain text config would allow just use the server even for static pages. Tcl config is cool developers idea but not really practical for the admins and non-developers. Zoran Vasiljevic wrote: > Am 11.08.2007 um 15:15 schrieb Stephen Deasey: > >> One problem with this is you can't add comments: >> >> section fastpath { >> cache false ;# Turn off caching >> ... >> } > > Well, you could be overriding the [unknown] and > eval'in the whole block. This would implicitly > mean that you should not have config option named > after any built-in Tcl command, yes. > > Altogether, I do not know if this all is worth > the trouble. It looks nicer, true. But is it > worth it? > > Cheers > Zoran > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Stephen D. <sd...@gm...> - 2007-08-11 18:32:09
|
On 8/11/07, Vlad Seryakov <vl...@cr...> wrote: > If the only problem is comments that can be done easy. > Benefit to make config easier, if you check mailing list NS/As, most > question are related to configuration, for web admins who is not > familiar with Tcl this is a showstopper, plain text config would allow > just use the server even for static pages. Tcl config is cool developers > idea but not really practical for the admins and non-developers. > There certainly are a lot of questions about configuring the server. I don't think I've seen one about ns_section/ns_param. The things that are hard about configuring the server are that there are a lot of knobs, it's not obvious what they do, or how they interact, and there's little documentation. Some things are hard because we are asking basically unknowable questions, like how many threads should should there be. Who knows? I don't think alternate syntax addresses any of these question, and worse, it introduces all kinds of gotchas so you can no longer explain it in a sentence as you can ns_section/ns_param. But, it's 5 lines of code at the top of your config file so everyones options are still open. Right? |
From: Vlad S. <vl...@cr...> - 2007-08-11 18:43:03
|
Sure, i am not advocating for config syntax change Stephen Deasey wrote: > On 8/11/07, Vlad Seryakov <vl...@cr...> wrote: >> If the only problem is comments that can be done easy. >> Benefit to make config easier, if you check mailing list NS/As, most >> question are related to configuration, for web admins who is not >> familiar with Tcl this is a showstopper, plain text config would allow >> just use the server even for static pages. Tcl config is cool developers >> idea but not really practical for the admins and non-developers. >> > > > There certainly are a lot of questions about configuring the server. I > don't think I've seen one about ns_section/ns_param. > > The things that are hard about configuring the server are that there > are a lot of knobs, it's not obvious what they do, or how they > interact, and there's little documentation. > > Some things are hard because we are asking basically unknowable > questions, like how many threads should should there be. Who knows? > > I don't think alternate syntax addresses any of these question, and > worse, it introduces all kinds of gotchas so you can no longer explain > it in a sentence as you can ns_section/ns_param. > > But, it's 5 lines of code at the top of your config file so everyones > options are still open. Right? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |
From: Zoran V. <zv...@ar...> - 2007-08-11 13:21:38
|
Hi! If you are going to that extent, why just not: ns_section section_name ?script? so you are aotomatically backwards compatible. Either you write: ns_section ns/fastpath { cache false cachemaxsize 512000 } or omit the block and just default to using ns_param. Also, I believe that sections should nest: ns_section ns/some/section { param value ns_section my/section { param1 value1 } } where param and value are assigned to ns/some/section and param1 and value1 are assigned to ns/some/section/my/section I would't use namespaces for config storage It be independent of Tcl interpreter as it is used throughout the code and, the startup interp gets trashed after startup anyway. Cheers Zoran > For example instead of this (or it could be used at the same time, > it is > not a replacement) > > ns_section "ns/fastpath" > ns_param cache false > ns_param cachemaxsize 5120000 > ns_param cachemaxentry 512000 > ns_param mmap false > > it may look like this (still Tcl) > > section "fastpath" { > cache false > cachemaxsize 5120000 > cachemaxentry 512000 > mmap false > } > > section "server/${servername}" { > connsperthread 0 > flushcontent false > maxconnections 100 > maxthreads 10 > minthreads 0 > threadtimeout 120 > } > > > As you can see this is Tcl command section > > proc section { name args } { > > ns_section ns/$name > foreach { key val } $args { > ns_param $key $val > } > } > > But config looks like more 21 century and more structured and > easier to > read. Very similar to lighttpd by the way. > > > -- > Vlad Seryakov > vl...@cr... > http://www.crystalballinc.com/vlad/ > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Vlad S. <vl...@cr...> - 2007-08-11 17:34:17
|
> > > (btw. I updated the wiki software and SF updated their servers. Seems > pretty responsive.) > It is much faster, is it possibly to import our documentation so we will have one common place for all docs? |
From: Stephen D. <sd...@gm...> - 2007-08-11 18:24:09
|
On 8/11/07, Vlad Seryakov <vl...@cr...> wrote: > > > > > > (btw. I updated the wiki software and SF updated their servers. Seems > > pretty responsive.) > > > > It is much faster, is it possibly to import our documentation so we will > have one common place for all docs? > The documentation in doc/src/* that isn't really a man page? Yeah, sounds like a good idea. dtplite can export in a wiki format I think... |