diff --git a/ConfigurationSystem/test/Test_agentOptions.py b/ConfigurationSystem/test/Test_agentOptions.py index ee554283054..38d632cf899 100644 --- a/ConfigurationSystem/test/Test_agentOptions.py +++ b/ConfigurationSystem/test/Test_agentOptions.py @@ -20,16 +20,8 @@ ('DIRAC.FrameworkSystem.Agent.ErrorMessageMonitor', {}), ('DIRAC.FrameworkSystem.Agent.SystemLoggingDBCleaner', {'IgnoreOptions': ['RemoveDate']}), ('DIRAC.FrameworkSystem.Agent.TopErrorMessagesReporter', {}), - ('DIRAC.RequestManagementSystem.Agent.CleanReqDBAgent', {'IgnoreOptions': ['KickLimit', 'KickGraceHours', - 'DeleteGraceDays']}), - ('DIRAC.RequestManagementSystem.Agent.RequestExecutingAgent', {'IgnoreOptions': ['MaxProcess', - 'ProcessTaskTimeout', - 'RequestsPerCycle', - 'OperationHandlers', - 'MinProcess', 'MaxAttempts', - 'ProcessPoolQueueSize', - 'ProcessPoolSleep', - 'FTSMode', + ('DIRAC.RequestManagementSystem.Agent.CleanReqDBAgent', {}), + ('DIRAC.RequestManagementSystem.Agent.RequestExecutingAgent', {'IgnoreOptions': ['FTSMode', 'OperationHandlers'], 'SpecialMocks': {'gConfig': S_OK([])}}), ('DIRAC.ResourceStatusSystem.Agent.CacheFeederAgent', {}), diff --git a/RequestManagementSystem/Agent/CleanReqDBAgent.py b/RequestManagementSystem/Agent/CleanReqDBAgent.py index ce2d6a2a975..7a4207df96d 100644 --- a/RequestManagementSystem/Agent/CleanReqDBAgent.py +++ b/RequestManagementSystem/Agent/CleanReqDBAgent.py @@ -4,19 +4,18 @@ # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2013/05/17 08:31:26 ######################################################################## -""" :mod: CleanReqDBAgent +"""Cleaning the RequestDB from obsolete records and kicking assigned requests - ===================== +.. literalinclude:: ../ConfigTemplate.cfg + :start-after: ##BEGIN CleanReqDBAgent + :end-before: ##END + :dedent: 2 + :caption: CleanReqDBAgent options - .. module: CleanReqDBAgent +.. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com - :synopsis: cleaning RequestDB from obsolete records and kicking assigned requests - - .. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com - - cleaning ReqDB from obsolete records and kicking assigned requests """ -__RCSID__ = "$Id: $" +__RCSID__ = "$Id$" # # # @file CleanReqDBAgent.py # @author Krzysztof.Ciba@NOSPAMgmail.com diff --git a/RequestManagementSystem/Agent/RequestExecutingAgent.py b/RequestManagementSystem/Agent/RequestExecutingAgent.py index ccc7c14b7d8..b061b3df591 100644 --- a/RequestManagementSystem/Agent/RequestExecutingAgent.py +++ b/RequestManagementSystem/Agent/RequestExecutingAgent.py @@ -4,17 +4,21 @@ # Date: 2013/03/12 15:36:47 ######################################################################## -""" :mod: RequestExecutingAgent +"""Agent processing the requests - =========================== + .. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com - .. module: RequestExecutingAgent +See also the information about the :ref:`requestManagementSystem`. - :synopsis: request executing agent +The following options can be set for the RequestExecutingAgent. The configuration also includes the +``OperationHandlers`` available in DIRAC. - .. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com +.. literalinclude:: ../ConfigTemplate.cfg + :start-after: ##BEGIN RequestExecutingAgent + :end-before: ##END + :dedent: 2 + :caption: RequestExecutingAgent options - request processing agent """ __RCSID__ = '$Id$' @@ -75,17 +79,15 @@ class RequestExecutingAgent(AgentModule): # # requests/cycle __requestsPerCycle = 100 # # minimal nb of subprocess running - __minProcess = 2 + __minProcess = 20 # # maximal nb of subprocess executed same time - __maxProcess = 4 + __maxProcess = 20 # # ProcessPool queue size __queueSize = 20 # # file timeout __fileTimeout = 300 # # operation timeout __operationTimeout = 300 - # # ProcessTask default timeout in seconds - __taskTimeout = 900 # # ProcessPool finalization timeout __poolTimeout = 900 # # ProcessPool sleep time @@ -104,7 +106,7 @@ def __init__(self, *args, **kwargs): self.log.info("Requests/cycle = %d" % self.__requestsPerCycle) self.__minProcess = self.am_getOption("MinProcess", self.__minProcess) self.log.info("ProcessPool min process = %d" % self.__minProcess) - self.__maxProcess = self.am_getOption("MaxProcess", 4) + self.__maxProcess = self.am_getOption("MaxProcess", self.__maxProcess) self.log.info("ProcessPool max process = %d" % self.__maxProcess) self.__queueSize = self.am_getOption("ProcessPoolQueueSize", self.__queueSize) self.log.info("ProcessPool queue size = %d" % self.__queueSize) @@ -112,7 +114,7 @@ def __init__(self, *args, **kwargs): self.log.info("ProcessPool timeout = %d seconds" % self.__poolTimeout) self.__poolSleep = int(self.am_getOption("ProcessPoolSleep", self.__poolSleep)) self.log.info("ProcessPool sleep time = %d seconds" % self.__poolSleep) - self.__bulkRequest = self.am_getOption("BulkRequest", 0) + self.__bulkRequest = self.am_getOption("BulkRequest", self.__bulkRequest) self.log.info("Bulk request size = %d" % self.__bulkRequest) # # keep config path and agent name diff --git a/RequestManagementSystem/ConfigTemplate.cfg b/RequestManagementSystem/ConfigTemplate.cfg index 273b2b78c0f..758cfd69959 100644 --- a/RequestManagementSystem/ConfigTemplate.cfg +++ b/RequestManagementSystem/ConfigTemplate.cfg @@ -1,13 +1,17 @@ Services { + ##BEGIN ReqManager ReqManager { Port = 9140 + # If > 0, delay retry for this many minutes + ConstantRequestDelay = 0 Authorization { Default = authenticated } } + ##END ReqProxy { Port = 9161 @@ -20,19 +24,23 @@ Services } Agents { + ##BEGIN RequestExecutingAgent RequestExecutingAgent { PollingTime = 60 - RequestsPerCycle = 50 - MinProcess = 1 - MaxProcess = 8 - ProcessPoolQueueSize = 25 + # number of Requests to execute per cycle + RequestsPerCycle = 100 + # minimum number of workers process in the ProcessPool + MinProcess = 20 + # maximum number of workers process in the ProcessPool; recommended to set it to the same value as MinProcess + MaxProcess = 20 + # queue depth of the ProcessPool + ProcessPoolQueueSize = 20 + # timeout for the ProcessPool finalization ProcessPoolTimeout = 900 - ProcessTaskTimeout = 900 - ProcessPoolSleep = 4 - #TimeOut = 300 - #TimeOutPerFile = 300 - MaxAttempts = 256 + # sleep time before retrying to get a free slot in the ProcessPool + ProcessPoolSleep = 5 + # If a positive integer n is given, we fetch n requests at once from the DB. Otherwise, one by one BulkRequest = 0 OperationHandlers { @@ -97,14 +105,22 @@ Agents } } } + ##END + ##BEGIN CleanReqDBAgent CleanReqDBAgent { PollingTime = 60 ControlDirectory = control/RequestManagement/CleanReqDBAgent - DeleteGraceDays = 30 + # How many days, until finished requests are deleted + DeleteGraceDays = 60 + # How many requests are deleted per cycle DeleteLimit = 100 + # If failed requests are deleted DeleteFailed = False - KickGraceHours = 2 - KickLimit = 100 + # How many hours a request can stay assigned + KickGraceHours = 1 + # How many requests are kicked per cycle + KickLimit = 10000 } + ##END } diff --git a/RequestManagementSystem/Service/ReqManagerHandler.py b/RequestManagementSystem/Service/ReqManagerHandler.py index 2e84b9f67ca..0e66123be21 100755 --- a/RequestManagementSystem/Service/ReqManagerHandler.py +++ b/RequestManagementSystem/Service/ReqManagerHandler.py @@ -1,11 +1,15 @@ ##################################################################### # File: ReqManagerHandler.py ######################################################################## -""" -:mod: ReqManagerHandler +"""Implementation of the RequestDB service in the DISET framework + + +.. literalinclude:: ../ConfigTemplate.cfg + :start-after: ##BEGIN ReqManager + :end-before: ##END + :dedent: 2 + :caption: ReqManager options -.. module: ReqManagerHandler - :synopsis: Implementation of the RequestDB service in the DISET framework """ __RCSID__ = "$Id$" diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Databases/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Databases/index.rst deleted file mode 100644 index 0d5ddfe8ec8..00000000000 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Databases/index.rst +++ /dev/null @@ -1,17 +0,0 @@ -Systems / RequestManagement / / Databases - Sub-subsection -============================================================================ - -Databases used by RequestManagement System. Note that each database is a separate subsection. - -+--------------------------------+----------------------------------------------+----------------------+ -| **Name** | **Description** | **Example** | -+--------------------------------+----------------------------------------------+----------------------+ -| ** | Subsection. Database name | RequestDB | -| */DBName* | Database name | DBName = RequestDB | -| */Host* | Database host server where the DB is located | Host = db01.in2p3.fr | -| */MaxQueueSize* | Maximum number of simultaneous queries to | MaxQueueSize = 10 | -| | the DB per instance of the client | | -+--------------------------------+----------------------------------------------+----------------------+ - -The databases associated to RequestManagement System are: -- RequestDB \ No newline at end of file diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/RequestManager/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/RequestManager/index.rst deleted file mode 100644 index c410e54a0a2..00000000000 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/RequestManager/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -Systems / WorkloadManagement / / Service / RequestManager - Sub-subsection -===================================================================================== - -RequestManager is the implementation of the RequestDB service in the DISET framework. - -Special options to configure this service are showed in the table below: - -+----------+----------------------------------------------------+-----------------------------+ -| **Name** | **Description** | **Example** | -+----------+----------------------------------------------------+-----------------------------+ -| *Path* | Define the path where the request files are stored | Path = /opt/dirac/requestDB | -+----------+----------------------------------------------------+-----------------------------+ - diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/index.rst deleted file mode 100644 index 31916288cf3..00000000000 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/Services/index.rst +++ /dev/null @@ -1,37 +0,0 @@ -Systems / RequestManagement / / Service - Sub-subsection -====================================================================== - -All the services have common options to be configured for each one. Those options are -presented in the following table: - -+-------------------------+----------------------------------------------+-----------------------------+ -| **Name** | **Description** | **Example** | -+-------------------------+----------------------------------------------+-----------------------------+ -| *LogLevel* | Level of log verbosity | LogLevel = INFO | -+-------------------------+----------------------------------------------+-----------------------------+ -| *LogBackends* | Log backends | LogBackends = stdout | -| | | LogBackends += server | -+-------------------------+----------------------------------------------+-----------------------------+ -| *MaskRequestParameters* | Request to mask the values, possible values: | MaskRequestParameters = yes | -| | yes or no | | -+-------------------------+----------------------------------------------+-----------------------------+ -| *MaxThreads* | Maximum number of threads used in parallel | MaxThreads = 50 | -| | for the server | | -+-------------------------+----------------------------------------------+-----------------------------+ -| *Port* | Port useb by DIRAC service | Port = 9140 | -+-------------------------+----------------------------------------------+-----------------------------+ -| *Protocol* | Protocol used to comunicate with the service | Protocol = dips | -+-------------------------+----------------------------------------------+-----------------------------+ -| *Authorization* | Subsection used to define which kind of | Authorization | -| | Authorization is required to talk with the | | -| | service | | -+-------------------------+----------------------------------------------+-----------------------------+ -| *Authorization/Default* | Define to who is required the authorization | Default = all | -+-------------------------+----------------------------------------------+-----------------------------+ - -DataStore services are: - -.. toctree:: - :maxdepth: 2 - - RequestManager/index diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/URLs/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/URLs/index.rst deleted file mode 100644 index ed245753c82..00000000000 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/URLs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -Systems / RequestManagement / / URLs - Sub-subsection -================================================================= - -RequestManagement Services URLs. - -+------------------+----------------------------------------+-------------------------------------------------------------------------------------+ -| **Name** | **Description** | **Example** | -+------------------+----------------------------------------+-------------------------------------------------------------------------------------+ -| ** | URL associated with the service, value | RequestManager = dips://dirac.eela.if.ufrj.br:9143/RequestManagement/RequestManager | -| | URL using dips protocol | | -+------------------+----------------------------------------+-------------------------------------------------------------------------------------+ - -Services associated with RequestManagement System: - -+------------------+----------+ -| **Service** | **Port** | -+------------------+----------+ -| *RequestManager* | 9143 | -+------------------+----------+ diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/index.rst deleted file mode 100644 index 53d970d64f8..00000000000 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/RequestManagement/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -RequestManagement System configuration -========================================= - -In this subsection are described the databases, services and URLs related with RequestManagement System for each setup. - -.. toctree:: - :maxdepth: 2 - - Databases/index - Services/index - URLs/index \ No newline at end of file diff --git a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/index.rst b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/index.rst index 0c827c47b34..64001a2b0e2 100644 --- a/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/index.rst +++ b/docs/source/AdministratorGuide/Configuration/ConfReference/Systems/index.rst @@ -5,6 +5,10 @@ Systems configuration Each DIRAC system has its corresponding section in the Configuration namespace. +.. note:: The configuration options for services and agents are being moved to the :ref:`Code + Documentation `. You can find the options for each service and agent + on the individual documentation page of the respective agent or service. + .. toctree:: :maxdepth: 1 @@ -12,7 +16,7 @@ Each DIRAC system has its corresponding section in the Configuration namespace. Configuration/index DataManagement/index WorkloadManagement/index - RequestManagement/index + /CodeDocumentation/RequestManagementSystem/RequestManagementSystem_Module Framework/index StorageManagement/index Transformation/index diff --git a/docs/source/AdministratorGuide/Systems/RequestManagement/rmsComponents.rst b/docs/source/AdministratorGuide/Systems/RequestManagement/rmsComponents.rst index 601dc78254d..de649c05aea 100644 --- a/docs/source/AdministratorGuide/Systems/RequestManagement/rmsComponents.rst +++ b/docs/source/AdministratorGuide/Systems/RequestManagement/rmsComponents.rst @@ -21,7 +21,7 @@ ReqManager This is the service in front of the DB. It has the following special configuration options: -* `constantRequestDelay`: (default 0 minut) if not 0, this is the constant retry delay we add when putting a Request back to the DB +* ``ConstantRequestDelay``: (default 0 minutes) if not 0, this is the constant retry delay we add when putting a Request back to the DB .. _RequestExecutinAgent: @@ -37,21 +37,7 @@ At the end of the execution, if the Request comes from a job, we set the job to The RequestExecutingAgent is one of the few that can be duplicated. There are protections to make sure that a Request is only processed by one REA at the time. -===================== -Configuration options -===================== - -On top of the standard agent options, the REA accepts the following configuration - - -* `BulkRequest` (default 0): If a positive integer `n` is given, we fetch `n` requests at once from the DB. Otherwise, one by one -* `MinProcess` (default 2): minimum number of workers process in the `ProcessPool` -* `MaxProcess` (default 4): maximum number of workers process in the `ProcessPool` -* `OperationHandlers`: There should be in this section one section per OperationHandler (see :ref:`rmsOpType`) -* `ProcessPoolQueueSize` (default 20): queue depth of the `ProcessPool` -* `ProcessPoolTimeout` (default 900 seconds): timeout for the `ProcessPool` finalization -* `ProcessPoolSleep` (default 5 seconds): sleep time before retrying to get a free slot in the `ProcessPool` -* `RequestsPerCycle` (default 100): number of Requests to execute per cycle +Configuration options are described :mod:`here `. ============== Retry strategy @@ -59,7 +45,7 @@ Retry strategy Operations are normally retried several times in case they fail. There is a delay between each execution, depending on the case: -* If the option `constantRequestDelay` is set in the :ref:`ReqManager`, then we apply that one +* If the option ``ConstantRequestDelay`` is set in the :ref:`ReqManager`, then we apply that one * If one of the StorageElement (source or target) is banned, then we wait 1 hour (except if the SE is always banned, then we fail the Operation) * Otherwise the delay increases following a logarithmic scale with the number of attempts @@ -69,13 +55,9 @@ Operations are normally retried several times in case they fail. There is a dela CleanReqDBAgent --------------- -This agent cleans the DB from old Requests in final state. Special configuration options are +This agent cleans the DB from old Requests in final state. -* `DeleteGraceDays`: (default 60) Delay after which Requests are removed -* `DeleteLimit`: (default 100) Maximum number of Requests to remove per cycle -* `DeleteFailed`: (default False) Whether to delete also Failed request -* `KickGraceHours`: (default 1) After how long we should kick the Requests in `Assigned` -* `KickLimit`: (default 10000) Maximum number of requests kicked by cycle +Configuration options are described :mod:`here `. .. _reqProxy: