Permalink
Browse files

exposing rabbit-prefetch-count and number of threads as config parame…

…ters
  • Loading branch information...
1 parent 01dcd7c commit 45b225588e71721280dc0f3a37026244a8428a5b @amitrathore committed Nov 16, 2010
@@ -58,6 +58,15 @@
(defn log-to-console? []
((operation-config) :log-to-console))
+(defn rabbitmq-prefetch-count []
+ ((operation-config) :rabbit-prefetch-count))
+
+(defn medusa-server-thread-count []
+ ((operation-config) :medusa-server-thread-count))
+
+(defn medusa-client-thread-count []
+ ((operation-config) :medusa-client-thread-count))
+
(defn config-for-rathore-utils [process-type-id]
{:log-to-console (log-to-console?)
:logs-dir ((operation-config) :logsdir)
@@ -19,7 +19,7 @@
(assoc (sevak-queue-message-no-return sevak-service args) :return-queue-name (return-queue-name sevak-service)))
(defn register-callback [return-q-name custom-handler request-object]
- (init-medusa 140)
+ (init-medusa (medusa-client-thread-count))
(register-callback-or-fallback return-q-name custom-handler request-object))
(defn new-proxy
@@ -80,9 +80,12 @@
(log-message "System config:" (operation-config))
(log-message "MPI transport Q:" (queue-sevak-q-name))
(log-message "MPI diagnostics Q:" (queue-diagnostics-q-name))
+ (log-message "Medusa server threads:" (medusa-server-thread-count))
+ (log-message "Medusa client threads:" (medusa-client-thread-count))
+ (log-message "RabbitMQ prefetch-count:" (rabbitmq-prefetch-count))
(log-message "Sevaks are offering the following" (count @sevaks) "services:" (keys @sevaks))
(init-rabbit)
- (init-medusa 300)
+ (init-medusa (medusa-server-thread-count))
;(send-message-on-queue (queue-diagnostics-q-name) {:message_type START-UP-REPORT :sevak_server_pid (process-pid) :sevak_name SEVAK-SERVER})
(future
@@ -101,7 +104,7 @@
(with-swarmiji-bindings
(try
(log-message "Starting to serve sevak requests...")
- (with-prefetch-count 300
+ (with-prefetch-count (rabbitmq-prefetch-count)
(start-queue-message-handler (queue-sevak-q-name) (queue-sevak-q-name) sevak-request-handling-listener))
(log-message "Done with sevak requests!")
(catch Exception e

0 comments on commit 45b2255

Please sign in to comment.