Dear naviserver community,
First, all the best in the new year!
A few days ago, i have merged the naviserver-connthreadqueue fork back
into the naviserver trunk, since the server is running since a few weeks
flawless in our production environment.
While doing some code cleanup and documentation polishing the current
state of the server introspection commands caught my attention. Some of
the commands seemed to be developed under the assumption that one nsd
process hosts just a single server with a single pool. I try to
summarize my understanding in this regards:
- One nsd might have multiple (virtual) servers with different
ip/port/driver.
- Every server has a default pool and optionally multiple additional
connection pools selected via url-mapping.
- Every pool might have different settings like
mintheads/maxthreads/..., but also different statistics.
In naviserver, we have essentially the two commands "ns_info" and
"ns_server" to obtain information about the "nds" process, about a
single (virtual) server and about (connection) pools.
##################################################################
#
# (1) infos about the global state of nsd
#
ns_info address
ns_info argv0
ns_info boottime
ns_info builddate
ns_info callbacks
ns_info config
ns_info home
ns_info hostname
ns_info locks
ns_info log
ns_info major
ns_info mimetypes
ns_info minor
ns_info name
ns_info nsd
ns_info server (name of the current server, executing this cmd)
ns_info servers (names of the defined servers)
ns_info shutdownpending
ns_info sockcallbacks
ns_info started
ns_info tag
ns_info threads
ns_info uptime
ns_info version
ns_info winnt *
#
# (2) info about a server, but currently just available
# for the "current" server
#
ns_info filters
ns_info pagedir
ns_info pageroot
ns_info requestprocs
ns_info tcllib
ns_info traces
ns_info url2file
#
# (3) info about the current server, with a potentially
# non-default pool
#
ns_server all ?pool? (union of [ns_server active]
and [ns_server queued])
ns_server active ?pool? (currently active connections
from the pool)
ns_server queued ?pool? (currently queued connection
from the pool)
ns_server connections ?pool? (total number of connections processed)
ns_server keepalive ?pool? * (always 0)
ns_server pools ?pool? (list names of pools)
ns_server threads ?pool? (info about currently running threads)
ns_server stats ?pool? (cumulative statistics from a single
server, e.g. requests, spools, ...)
ns_server waiting ?pool? (number of currently waiting
connections of the pool)
##################################################################
One can see from this summary, that the information about a single (the
current) server can be obtained in part from "ns_info" and in part from
"ns_server". Information about different servers cannot be obtained.
Information about pools can be ontained from ns_server, but just for the
current server. Furthermore, "ns_server" has subcommands, which are
independent from the pools, but still have a ?pool? argument. The
optional argument is irrelevant for the following commands:
ns_server connections ?pool?
ns_server keepalive ?pool?
ns_server pools ?pool?
ns_server stats ?pool?
I would propose to make the following changes to address these problems:
##################################################################
#
# Keep ns_info command from group (1) as it is, with the exception
# of "ns_info winnt" (see below).
#
# Turn previously ns_info commands (2) into ns_server commands, since
# these commands return info about a server. The ns_server command
# should be extended with an optional "-server" flag, which defaults
# to the current server.
#
ns_server ?-server server? filters
ns_server ?-server server? pagedir
ns_server ?-server server? pageroot
ns_server ?-server server? requestprocs
ns_server ?-server server? tcllib
ns_server ?-server server? traces
ns_server ?-server server? url2file
#
# modify the previously ns_server commands (3) with the unneeded
# trailing pool argument as follows:
#
# - remove the unneeded pool argument
# - add an optional "-server" flag, which defaults
# to the current server.
#
ns_server ?-server server? connections
ns_server ?-server server? pools
ns_server ?-server server? stats
#
# modify the previously ns_server commands (3) with the pool
# argument as follows:
# - add an optional "-pool" flag, which defaults to the
# default pool.
# - remove the pool argument
# - add an optional "-server" flag, which defaults to the
# current server (as above)
#
ns_server ?-server server? ?-pool pool? all
ns_server ?-server server? ?-pool pool? active
ns_server ?-server server? ?-pool pool? queued
ns_server ?-server server? ?-pool pool? threads
ns_server ?-server server? ?-pool pool? waiting
##################################################################
Some of the variants with the specified ?-server ...? might have
concurrency issues, but maybe it is not necessary to support for every
subcommand the "-server" flag from the beginning, since most
installations seem to have still single-server/single pool (SS-SP)
configs. But by going this way, we do can add this gradually without
facing the need to change the interface. For users with SS-SP the
previously defined "ns_server" commands are compatible. For "ns_info" it
should be possible to add a compatibility layer spitting out a
"deprecated" message before calling the new interface.
The commands
ns_info winnt
ns_server keepalive ?pool?
should be removed (the first one is obsoleted by ::tcl_platform, the
second one is a
dummy placeholder, which returns always the constant 0).
Comments?
-gustaf neumann
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel