]> git.ipfire.org Git - thirdparty/squid.git/commit - src/pconn.cc
SMP Cache Manager, Phase2 implementation.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 28 Oct 2010 18:52:59 +0000 (12:52 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 28 Oct 2010 18:52:59 +0000 (12:52 -0600)
commit8822ebee4947bcf883d74aa79a26e896449d0c36
tree017a4ce1c0cc750096b7daef0559bee3c161ccf3
parentb6aa37ec84fcaaf52ea72bdb7dc79829e27f10cc
SMP Cache Manager, Phase2 implementation.

Cache Manager actions are forwarded to Coordinator. Coordinator iterates over
Kids, aggregating their stats if possible and/or allowing each kid to dump
non-aggregatable output directly into response if needed. Non-aggregated
output is wrapped in "by kidN { ... } by kidN" markup to ease auto-processing.

Regressions and small output formatting changes are probably unavoidable
because stats are aggregated and passed around as doubles instead of integers
(no more overflows though!) and because many stats collection and formatting
lines had to be touched. These are steps in the right direction though, IMO.

Old code both computed and dumped stats to Store at the same time. To avoid
computing code duplication, we now collect stats in primitive Stats objects
and then either dump those to Store or send them to Coordinator for
aggregation and, eventual Store dump. What stats to collect, when to
aggregate, and when to dump is decided by action-specific Mgr::Action classes.

The Cache Manager menu now consists of ActionProfile objects. ActionProfile
maintains hard-coded information about specific actions. It uses ActionCreator
member to create Action objects when a cache manager request is received.

Added Mgr::ActionParams class to maintain action parameters, including HTTP
request details necessary for Store entry creation (in another strand) and
action-specific parameters (currently just credentials). In Phase3, this class
can be extended to supply more parameters such as kid IDs to which the action
should apply.

Added Mgr::Command that combines hard-coded ActionProfile details with
user-specified ActionParams. This simplifies many interfaces because we no
longer need to supply a long list of parameters, covering various parts of
action config.

Moved Cache Manager registration to Mgr::RegisterAction() globals to reduce
dependency on the CacheManager class, which is a singleton anyway, and which
is unused by most of the registration callers.  On the other hand, without
this change, no legacy (function-based actions) code would have been changed!

Enhanced TypedMsgHdr class to simplify storing and loading non-POD classes.
The caller can now easily handle a non-POD class as a series of put/get calls,
one for each POD member. This was necessary to send Mgr::ActionParams to
Coordinator and back. Will probably be useful for sending other complex
structures as well.

Reconfigure, shutdown, and other "basic" actions have been moved to
src/mgr/BasicActions.cc. Mgr::RegisterBasics() registers them.

Most of the Cache Manager code is now in src/mgr/.

Many more polishing touches.

More polishing left for future projects: Move CacheManager to Mgr namespace
and src/mgr/ directory. Use SBuf instead of String for ActionParams and
TypedMsgHdr. Rename Ipc::TypedMsgHdr to Ipc::Msg, Ipc::SocketMsg, or similar
because it maintains more than just msghdr struct. More stats aggregation,
and Phase3 changes.
118 files changed:
configure.in
src/CacheManager.h
src/DiskIO/DiskDaemon/DiskDaemonDiskIOModule.cc
src/DiskIO/DiskDaemon/DiskDaemonDiskIOModule.h
src/DiskIO/DiskDaemon/DiskdAction.cc [new file with mode: 0644]
src/DiskIO/DiskDaemon/DiskdAction.h [new file with mode: 0644]
src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc
src/HttpHeader.cc
src/Makefile.am
src/ProfStats.cc
src/Store.h
src/StoreIOBuffer.h
src/String.cc
src/acl/Asn.cc
src/auth/basic/auth_basic.cc
src/auth/digest/auth_digest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/base/AsyncJobCalls.h
src/cache_cf.cc
src/cache_manager.cc
src/carp.cc
src/cbdata.cc
src/client_db.cc
src/comm_epoll.cc
src/comm_kqueue.cc
src/comm_poll.cc
src/comm_select.cc
src/comm_select_win32.cc
src/delay_pools.cc
src/dns.cc
src/dns_internal.cc
src/event.cc
src/external_acl.cc
src/forward.cc
src/fqdncache.cc
src/fs/coss/StoreFScoss.cc
src/icmp/net_db.cc
src/ipc/Coordinator.cc
src/ipc/Coordinator.h
src/ipc/Makefile.am
src/ipc/Messages.h
src/ipc/Port.h
src/ipc/SharedListen.cc
src/ipc/Strand.cc
src/ipc/Strand.h
src/ipc/StrandCoord.cc [moved from src/ipc/Messages.cc with 73% similarity]
src/ipc/StrandCoord.h [new file with mode: 0644]
src/ipc/StrandCoords.h [new file with mode: 0644]
src/ipc/TypedMsgHdr.cc
src/ipc/TypedMsgHdr.h
src/ipc/forward.h [new file with mode: 0644]
src/ipcache.cc
src/log/access_log.cc
src/mem.cc
src/mgr/Action.cc [new file with mode: 0644]
src/mgr/Action.h [new file with mode: 0644]
src/mgr/ActionCreator.h [new file with mode: 0644]
src/mgr/ActionParams.cc [new file with mode: 0644]
src/mgr/ActionParams.h [new file with mode: 0644]
src/mgr/ActionProfile.h [new file with mode: 0644]
src/mgr/ActionWriter.cc [new file with mode: 0644]
src/mgr/ActionWriter.h [new file with mode: 0644]
src/mgr/BasicActions.cc [new file with mode: 0644]
src/mgr/BasicActions.h [new file with mode: 0644]
src/mgr/Command.cc [new file with mode: 0644]
src/mgr/Command.h [new file with mode: 0644]
src/mgr/CountersAction.cc [new file with mode: 0644]
src/mgr/CountersAction.h [new file with mode: 0644]
src/mgr/Filler.cc [new file with mode: 0644]
src/mgr/Filler.h [new file with mode: 0644]
src/mgr/Forwarder.cc [new file with mode: 0644]
src/mgr/Forwarder.h [new file with mode: 0644]
src/mgr/FunAction.cc [new file with mode: 0644]
src/mgr/FunAction.h [new file with mode: 0644]
src/mgr/InfoAction.cc [new file with mode: 0644]
src/mgr/InfoAction.h [new file with mode: 0644]
src/mgr/Inquirer.cc [new file with mode: 0644]
src/mgr/Inquirer.h [new file with mode: 0644]
src/mgr/IntervalAction.cc [new file with mode: 0644]
src/mgr/IntervalAction.h [new file with mode: 0644]
src/mgr/IoAction.cc [new file with mode: 0644]
src/mgr/IoAction.h [new file with mode: 0644]
src/mgr/Makefile.am [new file with mode: 0644]
src/mgr/Registration.cc [new file with mode: 0644]
src/mgr/Registration.h [new file with mode: 0644]
src/mgr/Request.cc [new file with mode: 0644]
src/mgr/Request.h [new file with mode: 0644]
src/mgr/Response.cc [new file with mode: 0644]
src/mgr/Response.h [new file with mode: 0644]
src/mgr/ServiceTimesAction.cc [new file with mode: 0644]
src/mgr/ServiceTimesAction.h [new file with mode: 0644]
src/mgr/StoreIoAction.cc [new file with mode: 0644]
src/mgr/StoreIoAction.h [new file with mode: 0644]
src/mgr/StoreToCommWriter.cc [new file with mode: 0644]
src/mgr/StoreToCommWriter.h [new file with mode: 0644]
src/mgr/forward.h [new file with mode: 0644]
src/neighbors.cc
src/pconn.cc
src/peer_sourcehash.cc
src/peer_userhash.cc
src/redirect.cc
src/refresh.cc
src/stat.cc
src/store.cc
src/store_digest.cc
src/store_io.cc
src/store_log.cc
src/structs.h
src/tests/stub_Port.cc [new file with mode: 0644]
src/tests/stub_TypedMsgHdr.cc [new file with mode: 0644]
src/tests/stub_UdsOp.cc [new file with mode: 0644]
src/tests/stub_cache_manager.cc
src/tests/stub_comm.cc
src/tests/stub_store_swapout.cc
src/tests/stub_tools.cc
src/tests/testCacheManager.cc
src/ufsdump.cc