diff --git a/modules/admin/controllers/systemconfig/Queue.php b/modules/admin/controllers/systemconfig/Queue.php
index d3f0c665c..6ae53634c 100644
--- a/modules/admin/controllers/systemconfig/Queue.php
+++ b/modules/admin/controllers/systemconfig/Queue.php
@@ -91,6 +91,13 @@ class Queue extends Base
throw new Exception('4444');
}
+ // Validate the process count.
+ $process_count = intval($vars->queue_process_count ?? 1);
+ if ($process_count < 1 || $process_count > 10)
+ {
+ throw new Exception('4444');
+ }
+
// Validate the key.
$key = trim($vars->queue_key ?? '');
if (strlen($key) < 16 || !ctype_alnum($key))
@@ -102,6 +109,7 @@ class Queue extends Base
Config::set("queue.enabled", $enabled);
Config::set("queue.driver", $driver);
Config::set("queue.interval", $interval);
+ Config::set("queue.process_count", $process_count);
Config::set("queue.key", $key);
Config::set("queue.$driver", $driver_config);
if (!Config::save())
diff --git a/modules/admin/lang/en.php b/modules/admin/lang/en.php
index 05f8bc4d0..84efb9734 100644
--- a/modules/admin/lang/en.php
+++ b/modules/admin/lang/en.php
@@ -283,12 +283,15 @@ $lang->og_extract_images_fallback = 'Use site default image only';
$lang->og_extract_hashtags = 'Extract Hashtags from Document';
$lang->og_use_nick_name = 'Include Author Name';
$lang->og_use_timestamps = 'Include Timestamps';
+$lang->cmd_queue_description = 'Improve response times by processing time-consuming tasks, such as sending notifications, asynchronously.
This is an experimental feature. It may not be stable depending on your hosting environment.';
$lang->cmd_queue_enabled = 'Use Task Queue';
$lang->cmd_queue_enabled_help = 'The task queue will stop accepting new tasks if you uncheck the above.';
$lang->cmd_queue_driver = 'Queue Driver';
$lang->cmd_queue_driver_help = 'Select the driver for the task queue that suits your hosting environment and website needs.
Some drivers such as Redis will need the corresponding program to be installed on the server.';
$lang->cmd_queue_interval = 'Calling Interval';
$lang->cmd_queue_interval_help = 'Use a scheduler such as crontab or systemd timer to call the script on a set interval.
All tasks are processed as soon as possible regardless of the interval, but a short interval means quick recovery from any error.
For web-based cron, this should not exceed the max_execution_time setting in php.ini.
The max_execution_time on this server is %d seconds.';
+$lang->cmd_queue_process_count = 'Process Count';
+$lang->cmd_queue_process_count_help = 'Use multiple processes to increase throughput. This may increase server load significantly.
Keep a value of 1 unless you have a high-performance dedicated server.
Multiprocessing is not supported when using web-based cron.';
$lang->cmd_queue_call_script = 'Processing Script';
$lang->cmd_queue_webcron_key = 'Webcron Auth Key';
$lang->cmd_queue_config_keys['host'] = 'Host';
diff --git a/modules/admin/lang/ko.php b/modules/admin/lang/ko.php
index 4e269e611..e45e4ab20 100644
--- a/modules/admin/lang/ko.php
+++ b/modules/admin/lang/ko.php
@@ -279,12 +279,15 @@ $lang->og_extract_images_fallback = '사이트 대표 이미지 사용';
$lang->og_extract_hashtags = '본문에서 해시태그 추출';
$lang->og_use_nick_name = '글 작성자 이름 표시';
$lang->og_use_timestamps = '글 작성/수정 시각 표시';
+$lang->cmd_queue_description = '메일 발송, 푸시알림 등 시간이 오래 걸리거나 외부 서비스와 연동하는 작업을 비동기 처리하여 응답 속도를 개선합니다.
실험적인 기능입니다. 호스팅 환경에 따라서는 안정적으로 작동하지 않을 수도 있습니다.';
$lang->cmd_queue_enabled = '비동기 작업 사용';
$lang->cmd_queue_enabled_help = '체크를 해제하면 더이상 작업을 접수하지 않습니다.';
$lang->cmd_queue_driver = '비동기 드라이버';
$lang->cmd_queue_driver_help = '비동기 작업을 관리할 방법을 설정합니다. 호스팅 환경과 사이트의 필요에 맞추어 선택하세요.
Redis 등 일부 드라이버는 서버에 해당 기능이 설치되어 있어야 사용할 수 있습니다.';
$lang->cmd_queue_interval = '호출 간격';
$lang->cmd_queue_interval_help = 'crontab, systemd timer, 웹크론 등을 사용하여 일정한 주기로 스크립트를 호출해 주십시오.
모든 비동기 작업은 호출 간격과 무관하게 실시간으로 처리되나, 호출 간격이 짧으면 장애 발생시 신속하게 복구됩니다.
웹크론 사용시에는 php.ini의 실행 시간 제한을 초과하지 않는 것이 좋습니다.
이 서버의 max_execution_time은 %d초로 설정되어 있습니다.';
+$lang->cmd_queue_process_count = '프로세스 갯수';
+$lang->cmd_queue_process_count_help = '여러 개의 프로세스를 동시에 실행하여 처리 용량을 늘립니다. 서버 부하가 증가할 수 있습니다.
고성능 단독서버가 아니라면 1을 유지하시기 바랍니다.
웹크론으로 호출한 경우에는 멀티프로세싱을 지원하지 않습니다.';
$lang->cmd_queue_call_script = '작업 처리 스크립트';
$lang->cmd_queue_webcron_key = '웹크론 인증키';
$lang->cmd_queue_config_keys['host'] = '호스트';
diff --git a/modules/admin/tpl/config_queue.html b/modules/admin/tpl/config_queue.html
index d6a3fc50e..1e873d488 100644
--- a/modules/admin/tpl/config_queue.html
+++ b/modules/admin/tpl/config_queue.html
@@ -3,6 +3,10 @@
{$lang->cmd_queue_process_count_help}
+