From 2718c8150f614e6d5c76f91d46f4ebb28e440124 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 11 Mar 2016 20:32:22 +0100 Subject: [PATCH 1/4] The table optimisation level calculation is now using the index size as well --- include/cron.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cron.php b/include/cron.php index d68bd7f08..db7d44be0 100644 --- a/include/cron.php +++ b/include/cron.php @@ -357,7 +357,7 @@ function cron_clear_cache(&$a) { continue; // Calculate fragmentation - $fragmentation = $table["Data_free"] / $table["Data_length"]; + $fragmentation = $table["Data_free"] / ($table["Data_length"] + $table["Index_length"]); logger("Table ".$table["Name"]." - Fragmentation level: ".round($fragmentation * 100, 2), LOGGER_DEBUG); From 3189f0e23c234ca78396bcf5d44ac02775e491fa Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 11 Mar 2016 20:43:31 +0100 Subject: [PATCH 2/4] Another fix for "goaway". Hopefully now finale. --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 43f69fc11..a70c7bf61 100644 --- a/boot.php +++ b/boot.php @@ -1558,7 +1558,7 @@ function killme() { * @brief Redirect to another URL and terminate this process. */ function goaway($s) { - if (!strstr(normalise_link($s), normalise_link(App::get_baseurl()))) + if (!strstr(normalise_link($s), "http://")) $s = App::get_baseurl()."/".$s; header("Location: $s"); From b12dbe8831953cf244a66074dc3338baaae02b8a Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 11 Mar 2016 23:28:11 +0100 Subject: [PATCH 3/4] The worker settings are now available in the admin settings --- mod/admin.php | 11 ++++++++++- view/templates/admin_site.tpl | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mod/admin.php b/mod/admin.php index e7c4f51b6..57a004f51 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -619,6 +619,9 @@ function admin_page_site_post(&$a) { $only_tag_search = ((x($_POST,'only_tag_search')) ? True : False); $rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0); $embedly = ((x($_POST,'embedly')) ? notags(trim($_POST['embedly'])) : ''); + $worker = ((x($_POST,'worker')) ? True : False); + $worker_queues = ((x($_POST,'worker_queues')) ? intval($_POST['worker_queues']) : 4); + $worker_dont_fork = ((x($_POST,'worker_dont_fork')) ? True : False); if($a->get_path() != "") $diaspora_enabled = false; @@ -765,7 +768,9 @@ function admin_page_site_post(&$a) { set_config('system','proxy_disabled', $proxy_disabled); set_config('system','old_pager', $old_pager); set_config('system','only_tag_search', $only_tag_search); - + set_config('system','worker', $worker); + set_config('system','worker_queues', $worker_queues); + set_config('system','worker_dont_fork', $worker_dont_fork); if($rino==2 and !function_exists('mcrypt_create_iv')) { notice(t("RINO2 needs mcrypt php extension to work.")); @@ -992,6 +997,10 @@ function admin_page_site(&$a) { '$rino' => array('rino', t("RINO Encryption"), intval(get_config('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")), '$embedly' => array('embedly', t("Embedly API key"), get_config('system','embedly'), t("Embedly is used to fetch additional data for web pages. This is an optional parameter.")), + '$worker' => array('worker', t("Enable 'worker' background processing"), get_config('system','worker'), t("The worker background processing limits the number of parallel background jobs to a maximum number and respects the system load.")), + '$worker_queues' => array('worker_queues', t("Maximum number of parallel workers"), get_config('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")), + '$worker_dont_fork' => array('worker_dont_fork', t("Don't use 'proc_open' with the worker"), get_config('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of poller calls in your crontab.")), + '$form_security_token' => get_form_security_token("admin_site") )); diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 91957d016..d43c6a8c4 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -152,6 +152,11 @@ {{include file="field_input.tpl" field=$max_comments}} {{include file="field_checkbox.tpl" field=$proxy_disabled}} {{include file="field_checkbox.tpl" field=$old_pager}} + + {{include file="field_checkbox.tpl" field=$worker}} + {{include file="field_input.tpl" field=$worker_queues}} + {{include file="field_checkbox.tpl" field=$worker_dont_fork}} +
From bc21fca34567ca0fb57eba6b2e2c38fb1b77462c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 11 Mar 2016 23:44:46 +0100 Subject: [PATCH 4/4] Remove the setting description from the documentation since it isn't a hidden one anymore. --- doc/htconfig.md | 3 --- mod/admin.php | 1 + view/templates/admin_site.tpl | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/htconfig.md b/doc/htconfig.md index f9c92bfa0..a36e0bef2 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -64,9 +64,6 @@ line to your .htconfig.php: * throttle_limit_week - Maximum number of posts that a user can send per week with the API. * throttle_limit_month - Maximum number of posts that a user can send per month with the API. * wall-to-wall_share (Boolean) - Displays forwarded posts like "wall-to-wall" posts. -* worker (Boolean) - (Experimental) Use the worker system instead of calling several background processes. Reduces the overall load and speeds up item delivery. -* worker_dont_fork (Boolean) - if enabled, the workers are only called from the poller process. Useful on systems that permit the use of "proc_open". -* worker_queues - Number of parallel workers. Default value is 10 queues. * xrd_timeout - Timeout for fetching the XRD links. Default value is 20 seconds. ## service_class ## diff --git a/mod/admin.php b/mod/admin.php index 57a004f51..28c8ed15c 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -909,6 +909,7 @@ function admin_page_site(&$a) { '$advanced' => t('Advanced'), '$portable_contacts' => t('Auto Discovered Contact Directory'), '$performance' => t('Performance'), + '$worker_title' => t('Worker'), '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'), '$baseurl' => $a->get_baseurl(true), // name, label, value, help string, extra data... diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index d43c6a8c4..f22319b69 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -152,11 +152,12 @@ {{include file="field_input.tpl" field=$max_comments}} {{include file="field_checkbox.tpl" field=$proxy_disabled}} {{include file="field_checkbox.tpl" field=$old_pager}} +
+

{{$worker_title}}

{{include file="field_checkbox.tpl" field=$worker}} {{include file="field_input.tpl" field=$worker_queues}} {{include file="field_checkbox.tpl" field=$worker_dont_fork}} -