Merge pull request #2409 from annando/1503-worker-setting

The worker settings are now available in the admin settings
This commit is contained in:
Tobias Diekershoff 2016-03-12 07:30:55 +01:00
commit ee2020caff
3 changed files with 17 additions and 4 deletions

View file

@ -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_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. * 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. * 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. * xrd_timeout - Timeout for fetching the XRD links. Default value is 20 seconds.
## service_class ## ## service_class ##

View file

@ -619,6 +619,9 @@ function admin_page_site_post(&$a) {
$only_tag_search = ((x($_POST,'only_tag_search')) ? True : False); $only_tag_search = ((x($_POST,'only_tag_search')) ? True : False);
$rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0); $rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0);
$embedly = ((x($_POST,'embedly')) ? notags(trim($_POST['embedly'])) : ''); $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() != "") if($a->get_path() != "")
$diaspora_enabled = false; $diaspora_enabled = false;
@ -765,7 +768,9 @@ function admin_page_site_post(&$a) {
set_config('system','proxy_disabled', $proxy_disabled); set_config('system','proxy_disabled', $proxy_disabled);
set_config('system','old_pager', $old_pager); set_config('system','old_pager', $old_pager);
set_config('system','only_tag_search', $only_tag_search); 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')) { if($rino==2 and !function_exists('mcrypt_create_iv')) {
notice(t("RINO2 needs mcrypt php extension to work.")); notice(t("RINO2 needs mcrypt php extension to work."));
@ -904,6 +909,7 @@ function admin_page_site(&$a) {
'$advanced' => t('Advanced'), '$advanced' => t('Advanced'),
'$portable_contacts' => t('Auto Discovered Contact Directory'), '$portable_contacts' => t('Auto Discovered Contact Directory'),
'$performance' => t('Performance'), '$performance' => t('Performance'),
'$worker_title' => t('Worker'),
'$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'), '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'),
'$baseurl' => $a->get_baseurl(true), '$baseurl' => $a->get_baseurl(true),
// name, label, value, help string, extra data... // name, label, value, help string, extra data...
@ -992,6 +998,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")), '$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("<a href='http://embed.ly'>Embedly</a> is used to fetch additional data for web pages. This is an optional parameter.")), '$embedly' => array('embedly', t("Embedly API key"), get_config('system','embedly'), t("<a href='http://embed.ly'>Embedly</a> 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") '$form_security_token' => get_form_security_token("admin_site")
)); ));

View file

@ -154,6 +154,12 @@
{{include file="field_checkbox.tpl" field=$old_pager}} {{include file="field_checkbox.tpl" field=$old_pager}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div> <div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
<h3>{{$worker_title}}</h3>
{{include file="field_checkbox.tpl" field=$worker}}
{{include file="field_input.tpl" field=$worker_queues}}
{{include file="field_checkbox.tpl" field=$worker_dont_fork}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit|escape:'html'}}" /></div>
</form> </form>
{{* separate form for relocate... *}} {{* separate form for relocate... *}}