summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 14:01:05 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:19:29 +0530
commit9f2ef60274dae8b302d691ba8d266cd76dcd7c4b (patch)
tree18eda89f71258fa4b631faa9e38dd09d8c2e04ee /xlators/performance/io-threads/src/io-threads.h
parentb1bbd77f16a13f8109d1e2e1b4ed869db1e86645 (diff)
io-threads: Support autoscaling volfile options
This commit finally makes the autoscaling feature visible to the user. Know that we're now using two separate thread-pools, one for data requests, called ordered thread-pool in io-threads, and the other for meta-data requests, called un-ordered thread-pool. We do not expose this information to the user to keep io-threads simple. Consequently, when the user specifies a min-threads and max-threads value, the number of threads assigned to each pool is equal, i.e. both pools start with their min threads set to half of the option "min-threads" and both scale up their threads at most up to half of option "max-threads". Volfile options will be added to the wiki and user-guide. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.h')
-rw-r--r--xlators/performance/io-threads/src/io-threads.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index a613884da45..3bc37a67d43 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -60,8 +60,8 @@ struct iot_request {
#define IOT_MIN_THREADS 32
#define IOT_MAX_THREADS 512
-#define IOT_SCALING_OFF 1
-#define IOT_SCALING_ON 2
+#define IOT_SCALING_OFF _gf_false
+#define IOT_SCALING_ON _gf_true
#define iot_ordered_scaling_on(conf) ((conf)->o_scaling == IOT_SCALING_ON)
#define iot_unordered_scaling_on(conf) ((conf)->u_scaling == IOT_SCALING_ON)
@@ -103,7 +103,7 @@ struct iot_conf {
int o_idle_time; /* in Secs. The idle time after which an
ordered thread exits.
*/
- int o_scaling; /* Set to IOT_SCALING_OFF if user does not want
+ gf_boolean_t o_scaling; /* Set to IOT_SCALING_OFF if user does not want
thread scaling on ordered threads.
If scaling is off, io-threads maintains
at least min_o_threads number of threads
@@ -124,7 +124,7 @@ struct iot_conf {
request for this amount of secs, it should
try to die.
*/
- int u_scaling; /* Set to IOT_SCALING_OFF if user does not want
+ gf_boolean_t u_scaling; /* Set to IOT_SCALING_OFF if user does not want
thread scaling on unordered threads.
If scaling is off, io-threads maintains
at least min_u_threads number of threads