From 9a7a303adc95cc3bbe7b98f90524e75298bd9fb6 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Mon, 11 May 2015 10:02:42 +0200 Subject: [PATCH 1/2] Raise number of executing jobs from 50 to 200 to optimize MQ speed --- src/AppserverIo/Appserver/MessageQueue/QueueWorker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php b/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php index 5cffaedbc..fe2d82cec 100644 --- a/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php +++ b/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php @@ -293,7 +293,7 @@ public function run() $inQueue = sizeof($jobsExecuting); // we only process 50 jobs in parallel - if ($inQueue < 50) { + if ($inQueue < 200) { // start the job and add it to the internal array $jobsExecuting[$message->getMessageId()] = new Job(clone $message, $application); @@ -302,7 +302,7 @@ public function run() } else { // log a message that queue is actually full - $application->getInitialContext()->getSystemLogger()->debug( + $application->getInitialContext()->getSystemLogger()->info( sprintf('Job queue full - (%d jobs/%d msg wait)', $inQueue, sizeof($messages)) ); } From 884a7287ec57b1add6859bc78544f11f39966697 Mon Sep 17 00:00:00 2001 From: Tim Wagner Date: Mon, 11 May 2015 10:05:45 +0200 Subject: [PATCH 2/2] Update code comment --- src/AppserverIo/Appserver/MessageQueue/QueueWorker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php b/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php index fe2d82cec..6650267c6 100644 --- a/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php +++ b/src/AppserverIo/Appserver/MessageQueue/QueueWorker.php @@ -292,7 +292,7 @@ public function run() // count messages in queue $inQueue = sizeof($jobsExecuting); - // we only process 50 jobs in parallel + // we only process 200 jobs in parallel if ($inQueue < 200) { // start the job and add it to the internal array $jobsExecuting[$message->getMessageId()] = new Job(clone $message, $application);