Active Working Thread Measurement

Yingyu Hsieh
2015/01/24

Server-client application

  • Server usually limit active thread to serve client's requests
  • Application capacity and service time are related to active thread
  • This project provides a sample to measure number of active thread

View agent_results.txt - the dataset of client responding time

Time needed to complete task

plot of chunk unnamed-chunk-2

Sort by time

  • The scanning time is like uniform distributed. Let's sort by time.
    plot of chunk unnamed-chunk-3
  • We can perceive active thread are clustered.

Estimation number of clusters

  • Use the formula below to calculate the thread number
    \[ \frac{total\_ agent\_number}{best\_cluster\_number} \]
  • Use pamk in fpc library

    library(fpc)
    pam.best <- pamk(x)
    cluster.number <- pam.best$nc
    active.thread <- round(length(x)/cluster.number, 1)
    
  • The best estimation number of clusters is 10

Estimation number of active thread

  • The active thread number is 12

    set.seed(1024)
    dc <- kmeans(sort(x), cluster.number)
    plot(sort(x), xlab="Agent", ylab="Task durating (seconds)",
    pch=20, col=dc$cluster)
    

    plot of chunk kmean