MarkLogic 任务服务器状态

MarkLogic taskserver status

我们在生产配置中有专用的 D 节点和 E 节点组。我正在尝试收集 D 节点组中所有主机的任务服务器的请求状态。我正在使用 xdmp:server-status(host_id,server_id) 其中 host_id 是 ID我们属于 D 节点组的六台主机之一,server_id 是 D 节点组的任务服务器的 ID。查询运行得很好,但我对输出中的某些元素感到困惑(见下文)。

  1. threadsmax_threads 元素有什么区别?我查找了 xdmp:server-status() 的 MarkLogic API ,看起来他们对这两个元素进行了相同的描述,这显然是错误的。
  2. 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>
    

是的,文档是错误的,我会就此提交错误,它们的意思可能与您的想法相同。 max-threads 是可以 运行 的最大线程数,threads 是当前 'running' 线程数。请求状态的总和应该(通常)匹配线程。由于线程处于 'pool' 中,因此总和不完全匹配的时期。

你可以试试这个做个简单的测试。

for $i in 1 to 1000 return 
xdmp:spawn-function( function () { xdmp:sleep(10000) } )

它应该return立即用 1000 个任务填充队列。

然后运行这个偶尔

xdmp:server-status(xdmp:host(),xdmp:server("TaskServer")) ! (./*:threads,count(./*:request-statuses/*:request-status))