Difference between revisions of "What's new in 4.5"

From AOLserver Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
These two commands can be used together to map slow running requests to a specific pool and to set limits to avoid overload.
 
These two commands can be used together to map slow running requests to a specific pool and to set limits to avoid overload.
  
* New '''ns_pools''' command to map method/URL's to specific thread pools.
+
* New '''[[ns_pools]]''' command to map method/URL's to specific thread pools.
* New '''ns_limits''' command  control the number of threads executing and/or waiting for execution by method/URL.
+
* New '''[[ns_limits]]''' command  control the number of threads executing and/or waiting for execution by method/URL.
 
*'''Note:''' The new scheme does not pick up connection thread pool configurations from earlier versions of AOLServer. Please see the new example configuration files, and the documentation for [[ns_pools]] and [[ns_limits]], for instructions in upgrading your configuration.   
 
*'''Note:''' The new scheme does not pick up connection thread pool configurations from earlier versions of AOLServer. Please see the new example configuration files, and the documentation for [[ns_pools]] and [[ns_limits]], for instructions in upgrading your configuration.   
 
** As of 1 August 2007, the HEAD revision contains "pools.tcl", which will handle many pre-4.5 configurations.
 
** As of 1 August 2007, the HEAD revision contains "pools.tcl", which will handle many pre-4.5 configurations.
Line 19: Line 19:
 
* Added ability to manage larger file uploads by spooling to a temporary file (currenty not for Windows).
 
* Added ability to manage larger file uploads by spooling to a temporary file (currenty not for Windows).
  
* New '''[[nsproxy]]''' module which provides the '''ns_proxy command''' which enables sending Tcl scripts to a proxy process connected via a pipe. The proxy includes core Tcl commands as well as AOLserver commands from the libnsd library. Evaluating scripts in a proxy process can be used to isolate and/or timeout thread-unsafe or otherwise unsafe 3rd party code.
+
* New '''[[nsproxy]]''' module which provides the '''ns_proxy''' command which enables sending Tcl scripts to a proxy process connected via a pipe. The proxy includes core Tcl commands as well as AOLserver commands from the libnsd library. Evaluating scripts in a proxy process can be used to isolate and/or timeout thread-unsafe or otherwise unsafe 3rd party code.
  
 
=== ADP Improvements: ===
 
=== ADP Improvements: ===
Line 42: Line 42:
 
* New '''[[ns_internalredirect]]''' command to restart connection processing with a new URL.
 
* New '''[[ns_internalredirect]]''' command to restart connection processing with a new URL.
 
* 4.5.1 - Added '''ns_conn channel''' and '''ns_conn contentsentlength''' subcommands to [[ns_conn]] to allow raw communication via Tcl I/O to the remote client.
 
* 4.5.1 - Added '''ns_conn channel''' and '''ns_conn contentsentlength''' subcommands to [[ns_conn]] to allow raw communication via Tcl I/O to the remote client.
* New '''[[ns_cache]]''' command based on ideas from the [[nscache]] module.  This is semi-backward-compatible with the ns_cache module (differences are described in detail in [[ns_cache]]).
+
* New '''[[ns_cache]]''' command based on ideas from the [[nscache]] module.  This is semi-backward-compatible with the ns_cache module (differences are described in detail in '''[[ns_cache]]''').
 
* New '''[[ns_loop_ctl]]''' command to monitor and manage ''for'', ''while'', and ''foreach'' loops.
 
* New '''[[ns_loop_ctl]]''' command to monitor and manage ''for'', ''while'', and ''foreach'' loops.
 
* Added '''ns_ictl once''' subcommand to [[ns_ictl]] / [[ns_interp_ctl]] command to execute a script exactly once for a virtual server (i.e. at startup).
 
* Added '''ns_ictl once''' subcommand to [[ns_ictl]] / [[ns_interp_ctl]] command to execute a script exactly once for a virtual server (i.e. at startup).
Line 51: Line 51:
 
* 4.5.1 - New '''[[ns_register_cgi]]''' command to dynamically register a CGI executable to a url.
 
* 4.5.1 - New '''[[ns_register_cgi]]''' command to dynamically register a CGI executable to a url.
 
* New '''[[ns_driver]]''' command to get some stats on socket drivers.
 
* New '''[[ns_driver]]''' command to get some stats on socket drivers.
* [[nszlib]] module is now integrated into the core and provides for on-the-fly gzip compression and other gzip facilities in [[ns_gzip]]
+
* [[nszlib]] module is now integrated into the core and provides for on-the-fly gzip compression and other gzip facilities in '''[[ns_gzip]]'''
 
* -all switch added to '''[[ns_addrbyhost]]''' command.
 
* -all switch added to '''[[ns_addrbyhost]]''' command.
 
* Added ability to access more AOLserver functionality from a tclsh (nsv_*, ns_thread, etc).
 
* Added ability to access more AOLserver functionality from a tclsh (nsv_*, ns_thread, etc).
 
* Stack checking has returned.  In a multi-threaded application like AOLserver, stack checking is important for detecting buffer overruns and deep call trees blowing your thread stack, etc.
 
* Stack checking has returned.  In a multi-threaded application like AOLserver, stack checking is important for detecting buffer overruns and deep call trees blowing your thread stack, etc.
 
* More detailed information when logging uncaught Tcl errors.  Especially for connection threads, details of the HTTP request are logged to make diagnosing the root cause of errors easier.
 
* More detailed information when logging uncaught Tcl errors.  Especially for connection threads, details of the HTTP request are logged to make diagnosing the root cause of errors easier.

Revision as of 01:28, 19 June 2010

This is a fairly comprehensive list of new features and changes in AOLserver 4.5 and 4.5.1 (compared to 4.0). If you know of anything that is missing, please add it.

Connection Management:

These two commands can be used together to map slow running requests to a specific pool and to set limits to avoid overload.

  • New ns_pools command to map method/URL's to specific thread pools.
  • New ns_limits command control the number of threads executing and/or waiting for execution by method/URL.
  • Note: The new scheme does not pick up connection thread pool configurations from earlier versions of AOLServer. Please see the new example configuration files, and the documentation for ns_pools and ns_limits, for instructions in upgrading your configuration.
    • As of 1 August 2007, the HEAD revision contains "pools.tcl", which will handle many pre-4.5 configurations.
    • There are known issues when using this feature in conjunction with virtual servers; see the SourceForge bug list (and development mailing list archive) for details.

I/O Features:

  • New Ns_QueueWait API to enable event-driven callbacks in the driver thread before dispatching to pools for processing.
The allows drivers to augment data received from the client (headers, request, content) with additional data fetched over the network (likely stored in the new Ns_Cls "connection local storage" API's) before dispatching to the connection threads. An example would be to add certain personalization data received via a web service. The rationale here is that I/O events are cheap so do those upfront instead of having expensive connection threads burdened with wasteful blocking I/O. This is a somewhat obscure and technical interface.
  • Added ability to manage larger file uploads by spooling to a temporary file (currenty not for Windows).
  • New nsproxy module which provides the ns_proxy command which enables sending Tcl scripts to a proxy process connected via a pipe. The proxy includes core Tcl commands as well as AOLserver commands from the libnsd library. Evaluating scripts in a proxy process can be used to isolate and/or timeout thread-unsafe or otherwise unsafe 3rd party code.

ADP Improvements:

  • Added a new execution caching technique at the ns_adp_include level which allows you to save the results of execution of an included ADP and includes below that for reuse on subsequent connections up to a specified time.
  • Added singlescript config option which turns ADP pages into a single script enabling syntax such as "<% foreach e $list { %> element <%= $e %> here <% } %>".
  • Added support for nested adp tags, i.e. you can now do <% ns_adp_puts [ns_adp_eval {<% ... %>}] %> or use <% %> script within the body of a fancy tag. Note that there is a known issue in that only a single inner instance of an adp tag is supported - see Bug #2958550.
  • Introduced a better command name to clear long-standing confusion between the previous registertag commands: ns_adp_registerscript instead of ns_register_adptag.
  • Added ns_adp_registerproc which is similar to ns_adp_registerscript but the procedure receives individual arguments instead of an ns_set.
  • Added output buffer improvements via new Ns_ConnFlush. See ns_adp_close and ns_adp_flush
  • Added automatic UTF-8 to output charset encoding.
  • Added gzip output compression.
  • Added streaming output in chunked-encoding format instead of the previous "response with no length" HTTP/1.0 method.
  • Enhanced ADP error handling and reporting.
  • Added ability to trace ADP pages. Trace output is written to the server log. See ns_adp_ctl, which is a new command for configuring the ADP execution environment at runtime.

Other Improvements:

  • New Ns_TclRegisterTrace API to enable callbacks at key state transition points in a much more natural way. The ns_ictl command, which now has a second and better name that should be used going forward - ns_interp_ctl, has been updated to support script-level traces.
  • New Ns_Task API designed to replace the old Ns_SockCallback API which didn't do a very good job at managing timeouts along with I/O events.
  • New ns_returnmoved command to return 301 http status code and redirect to a new URL.
  • New ns_internalredirect command to restart connection processing with a new URL.
  • 4.5.1 - Added ns_conn channel and ns_conn contentsentlength subcommands to ns_conn to allow raw communication via Tcl I/O to the remote client.
  • New ns_cache command based on ideas from the nscache module. This is semi-backward-compatible with the ns_cache module (differences are described in detail in ns_cache).
  • New ns_loop_ctl command to monitor and manage for, while, and foreach loops.
  • Added ns_ictl once subcommand to ns_ictl / ns_interp_ctl command to execute a script exactly once for a virtual server (i.e. at startup).
  • Added ns_ictl package subcommand to ns_ictl / ns_interp_ctl command to handle loading of Tcl packages.
  • Added ns_ictl cancel subcommand to ns_ictl / ns_interp_ctl command to provide the ability to sendr async-cancel messages to any interpter listed in ns_ictl threads (another new subcommand)
  • New ns_register_fastpath command to re-enable fastpath after a previous call to ns_register_proc.
  • New ns_register_encoding command to enable mapping of method/URL combinations to specific charset encodings used to decode the request.
  • 4.5.1 - New ns_register_cgi command to dynamically register a CGI executable to a url.
  • New ns_driver command to get some stats on socket drivers.
  • nszlib module is now integrated into the core and provides for on-the-fly gzip compression and other gzip facilities in ns_gzip
  • -all switch added to ns_addrbyhost command.
  • Added ability to access more AOLserver functionality from a tclsh (nsv_*, ns_thread, etc).
  • Stack checking has returned. In a multi-threaded application like AOLserver, stack checking is important for detecting buffer overruns and deep call trees blowing your thread stack, etc.
  • More detailed information when logging uncaught Tcl errors. Especially for connection threads, details of the HTTP request are logged to make diagnosing the root cause of errors easier.