我们在生产配置中有专用的D节点和E节点组。我试图在D节点组中的所有主机上收集任务服务器的请求状态。我正在使用 xdmp:server-status(host_id,server_id)其中 host_id 是属于D节点组的六个主机之一的ID,以及 server_id 是D节点组的任务服务器的ID。查询运行得很好,但我对输出中的某些元素感到困惑(见下文)。
request_status元素的总和是否表示正在运行的任务数?这可能是直观的,但只是想确认一下。
<server-status xmlns="http://marklogic.com/xdmp/status/server">
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<server-kind>task-server</server-kind>
<enabled>true</enabled>
<threads>9</threads>
<max-threads>16</max-threads>
<max-time-limit>3600</max-time-limit>
<default-time-limit>600</default-time-limit>
<current-time>2015-08-26T04:06:41.622879-04:00</current-time>
<request-statuses>
<request-status>
<request-id>17847109729564550394</request-id>
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<transaction-id>11386673421668364533</transaction-id>
<canceled>false</canceled>
<modules>16882056828749629778</modules>
<database>13691199455930504749</database>
<root>/</root>
<request-kind>invoke</request-kind>
<request-text>/MarkLogic/cpf/triggers/on-state-enter.xqy</request-text>
<update>false</update>
<start-time>2015-08-26T04:06:41.621354-04:00</start-time>
<time-limit>600</time-limit>
<max-time-limit>3600</max-time-limit>
<user>15525372533614500271</user>
<trigger-depth>0</trigger-depth>
<expanded-tree-cache-hits>0</expanded-tree-cache-hits>
<expanded-tree-cache-misses>0</expanded-tree-cache-misses>
<request-state>running</request-state>
<profiling-allowed>true</profiling-allowed>
<profiling-enabled>false</profiling-enabled>
<debugging-allowed>true</debugging-allowed>
<debugging-status>detached</debugging-status>
<retry-count>0</retry-count>
</request-status>
<request-status>
<request-id>8474714682726605430</request-id>
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<transaction-id>8554209989266201299</transaction-id>
<canceled>false</canceled>
<modules>16882056828749629778</modules>
<database>13691199455930504749</database>
<root>/</root>
<request-kind>invoke</request-kind>
<request-text>/MarkLogic/cpf/triggers/on-state-enter.xqy</request-text>
<update>true</update>
<start-time>2015-08-26T04:06:41.483786-04:00</start-time>
<time-limit>600</time-limit>
<max-time-limit>3600</max-time-limit>
<user>15525372533614500271</user>
<trigger-depth>0</trigger-depth>
<expanded-tree-cache-hits>20</expanded-tree-cache-hits>
<expanded-tree-cache-misses>0</expanded-tree-cache-misses>
<request-state>running</request-state>
<profiling-allowed>true</profiling-allowed>
<profiling-enabled>false</profiling-enabled>
<debugging-allowed>true</debugging-allowed>
<debugging-status>detached</debugging-status>
<retry-count>0</retry-count>
</request-status>
<request-status>
<request-id>6530741740134403011</request-id>
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<transaction-id>14792921325069589956</transaction-id>
<canceled>false</canceled>
<modules>16882056828749629778</modules>
<database>13691199455930504749</database>
<root>/</root>
<request-kind>invoke</request-kind>
<request-text>/MarkLogic/cpf/triggers/on-state-enter.xqy</request-text>
<update>true</update>
<start-time>2015-08-26T04:06:41.52227-04:00</start-time>
<time-limit>600</time-limit>
<max-time-limit>3600</max-time-limit>
<user>15525372533614500271</user>
<trigger-depth>0</trigger-depth>
<expanded-tree-cache-hits>20</expanded-tree-cache-hits>
<expanded-tree-cache-misses>0</expanded-tree-cache-misses>
<request-state>running</request-state>
<profiling-allowed>true</profiling-allowed>
<profiling-enabled>false</profiling-enabled>
<debugging-allowed>true</debugging-allowed>
<debugging-status>detached</debugging-status>
<retry-count>0</retry-count>
</request-status>
<request-status>
<request-id>9441948619847315123</request-id>
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<transaction-id>13501074757179797206</transaction-id>
<canceled>false</canceled>
<modules>16882056828749629778</modules>
<database>13691199455930504749</database>
<root>/</root>
<request-kind>invoke</request-kind>
<request-text>/MarkLogic/cpf/triggers/on-status-enter.xqy</request-text>
<update>false</update>
<start-time>2015-08-26T04:06:41.594876-04:00</start-time>
<time-limit>600</time-limit>
<max-time-limit>3600</max-time-limit>
<user>15525372533614500271</user>
<trigger-depth>0</trigger-depth>
<expanded-tree-cache-hits>0</expanded-tree-cache-hits>
<expanded-tree-cache-misses>0</expanded-tree-cache-misses>
<request-state>running</request-state>
<profiling-allowed>true</profiling-allowed>
<profiling-enabled>false</profiling-enabled>
<debugging-allowed>true</debugging-allowed>
<debugging-status>detached</debugging-status>
<retry-count>0</retry-count>
</request-status>
<request-status>
<request-id>3267724788720707644</request-id>
<server-id>11927597993558616659</server-id>
<host-id>10652389071003024571</host-id>
<transaction-id>16009199203479096620</transaction-id>
<canceled>false</canceled>
<modules>16882056828749629778</modules>
<database>13691199455930504749</database>
<root>/</root>
<request-kind>invoke</request-kind>
<request-text>/MarkLogic/cpf/triggers/on-state-enter.xqy</request-text>
<update>true</update>
<start-time>2015-08-26T04:06:41.483616-04:00</start-time>
<time-limit>600</time-limit>
<max-time-limit>3600</max-time-limit>
<user>13094335114653925163</user>
<trigger-depth>0</trigger-depth>
<expanded-tree-cache-hits>20</expanded-tree-cache-hits>
<expanded-tree-cache-misses>0</expanded-tree-cache-misses>
<request-state>running</request-state>
<profiling-allowed>true</profiling-allowed>
<profiling-enabled>false</profiling-enabled>
<debugging-allowed>true</debugging-allowed>
<debugging-status>detached</debugging-status>
<retry-count>0</retry-count>
</request-status>
</request-statuses>
<request-rate>16.11519</request-rate>
<queue-size>0</queue-size>
<queue-limit>100000</queue-limit>
<expanded-tree-cache-hits>241396964</expanded-tree-cache-hits>
<expanded-tree-cache-misses>65339949</expanded-tree-cache-misses>
<expanded-tree-cache-hit-rate>161.5713</expanded-tree-cache-hit-rate>
<expanded-tree-cache-miss-rate>8.095861</expanded-tree-cache-miss-rate>
<fs-program-cache-hits>26819890</fs-program-cache-hits>
<fs-program-cache-misses>26819890</fs-program-cache-misses>
<db-program-cache-hits>3632389</db-program-cache-hits>
<db-program-cache-misses>3632389</db-program-cache-misses>
<fs-main-module-seq-cache-hits>4694</fs-main-module-seq-cache-hits>
<fs-main-module-seq-cache-misses>4694</fs-main-module-seq-cache-misses>
<db-main-module-seq-cache-hits>15144</db-main-module-seq-cache-hits>
<db-main-module-seq-cache-misses>15144</db-main-module-seq-cache-misses>
<fs-lib-module-cache-hits>1102986</fs-lib-module-cache-hits>
<fs-lib-module-cache-misses>1102986</fs-lib-module-cache-misses>
<db-lib-module-cache-hits>14221</db-lib-module-cache-hits>
<db-lib-module-cache-misses>14221</db-lib-module-cache-misses>
答案 0 :(得分:1)
是的,文档是错的,我会提出一个错误,它们意味着你可能会想到的。 max-threads是可以运行的最大线程数,threads是当前“正在运行”的线程数。请求状态的总和应该(通常)匹配线程。由于线程位于“池”中,因此存在总和不完全匹配的时段。
您可以尝试进行简单的测试。
for $i in 1 to 1000 return
xdmp:spawn-function( function () { xdmp:sleep(10000) } )
它应该立即返回填充1000个任务的队列。
然后偶尔运行
xdmp:server-status(xdmp:host(),xdmp:server("TaskServer")) ! (./*:threads,count(./*:request-statuses/*:request-status))