From 4c4db6f73cc6702d26fbbea85ff45eb91fb20a0c Mon Sep 17 00:00:00 2001 From: zottel Date: Fri, 27 Nov 2015 10:35:31 +0100 Subject: added info about Apache settings to avoid Apache running wild --- install/INSTALL.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'install') diff --git a/install/INSTALL.txt b/install/INSTALL.txt index c81510522..25852497b 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -341,3 +341,44 @@ This is obvious as soon as you notice that the cron uses proc_open to execute php-scripts that also use proc_open, but it took me quite some time to find that out. I hope this saves some time for other people using suhosin with function blacklists. + +##################################################################### +- Apache processes hanging, using as much CPU as they can +##################################################################### + +This seems to happen sometimes if you use mpm_prefork and the PHP process +started by Apache cannot get database access. + +Consider the following settings: + +In /etc/apache2/mods-enabled/mpm_prefork.conf (Debian, path and file name +may vary depending on your OS and distribution), set + + GracefulShutdownTimeout 300 + +This makes sure that Apache processes that are running wild will not do so +forever, but will be killed if they didn't stop five minutes after a +shutdown command was sent to the process. + +If you expect high load on your server (public servers, e.g.), also make +sure that Apache will not spawn more processes than MySQL will accept +connections. + +In the default Debian configuration, in +/etc/apache2/mods-enabled/mpm_prefork.conf the maximum number of workers +is set to 150: + + MaxRequestWorkers 150 + +However, in /etc/mysql/my.cnf the maximum number of connection is set to +100: + + max_connections = 100 + +150 workers are a lot and probably too much for small servers. However you +set those values, make sure that the number of Apache workers is smaller +than the number of connections MySQL accepts, leaving some room for other +stuff on your server that might access MySQL, and Hubzilla's poller which +needs MySQL access, too. A good setting for a medium-sized hub might be to +keep MySQL's max_connections at 100 and set mpm_prefork's +MaxRequestWorkers to 70. -- cgit v1.2.3 From 36ef1d1bc63d6c2040947ee9c18ba16072ffb76e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 5 Dec 2015 13:24:58 -0800 Subject: move the instance stuff to abook where it belongs --- install/schema_mysql.sql | 1 + install/schema_postgres.sql | 1 + install/update.php | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 3dab6c822..9c24cbd94 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -23,6 +23,7 @@ CREATE TABLE IF NOT EXISTS `abook` ( `abook_profile` char(64) NOT NULL DEFAULT '', `abook_incl` TEXT NOT NULL DEFAULT '', `abook_excl` TEXT NOT NULL DEFAULT '', + `abook_instance` TEXT NOT NULL DEFAULT '', PRIMARY KEY (`abook_id`), KEY `abook_account` (`abook_account`), KEY `abook_channel` (`abook_channel`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 95ed9acb7..0214c0c2a 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -22,6 +22,7 @@ CREATE TABLE "abook" ( "abook_profile" char(64) NOT NULL DEFAULT '', "abook_incl" TEXT NOT NULL DEFAULT '', "abook_excl" TEXT NOT NULL DEFAULT '', + "abook_instance" TEXT NOT NULL DEFAULT '', PRIMARY KEY ("abook_id") ); create index "abook_account" on abook ("abook_account"); diff --git a/install/update.php b/install/update.php index 10ae6725e..37351656f 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Sun, 6 Dec 2015 14:25:47 -0800 Subject: update error --- install/update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/update.php b/install/update.php index 37351656f..24f4f21d5 100644 --- a/install/update.php +++ b/install/update.php @@ -1951,7 +1951,7 @@ function update_r1159() { function update_r1160() { - $r1 = q("alter table abook add abook_instance text not null default '' "); + $r = q("alter table abook add abook_instance text not null default '' "); if($r) return UPDATE_SUCCESS; return UPDATE_FAILED; -- cgit v1.2.3 From d0482133a5a29deec31a6f267769c1d1fde170ad Mon Sep 17 00:00:00 2001 From: royalterra Date: Fri, 11 Dec 2015 09:48:04 +0000 Subject: Update INSTALL.txt --- install/INSTALL.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'install') diff --git a/install/INSTALL.txt b/install/INSTALL.txt index 25852497b..1a8118a25 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -382,3 +382,18 @@ stuff on your server that might access MySQL, and Hubzilla's poller which needs MySQL access, too. A good setting for a medium-sized hub might be to keep MySQL's max_connections at 100 and set mpm_prefork's MaxRequestWorkers to 70. +------------------------------------------------------------------------ +For Calculate Automatic according to your server resources and configure +mod_prefork you can Install and Execute ApacheTune + +Home Page: https://github.com/royalterra/apache2tune + +git clone https://github.com/royalterra/apache2tune.git + +cd apache2tune + +chmod +x Apache2tune.sh + +Please Read the Documentation of Apache2tune +./Apache2tune.sh + -- cgit v1.2.3 From 46332732793c24771fea51b0d54975e0954ff669 Mon Sep 17 00:00:00 2001 From: royalterra Date: Fri, 11 Dec 2015 09:49:14 +0000 Subject: Update INSTALL.txt Add Link to ApacheTune for configure mod Prefork --- install/INSTALL.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'install') diff --git a/install/INSTALL.txt b/install/INSTALL.txt index 1a8118a25..361153e59 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -397,3 +397,4 @@ chmod +x Apache2tune.sh Please Read the Documentation of Apache2tune ./Apache2tune.sh + -- cgit v1.2.3 From fb5ac37ca25cd75f1590491c3a8fff440d3c1632 Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Sat, 12 Dec 2015 17:30:02 +0100 Subject: That script is taken from someone else without any contribution (http://blog.strictly-software.com/2013/07/apache-performance-tuning-bash-script.html). Also the English is very bad. Anyway, I've replaced it with some general tips that all web admins should know. --- install/INSTALL.txt | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'install') diff --git a/install/INSTALL.txt b/install/INSTALL.txt index 361153e59..b1f940908 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -382,19 +382,8 @@ stuff on your server that might access MySQL, and Hubzilla's poller which needs MySQL access, too. A good setting for a medium-sized hub might be to keep MySQL's max_connections at 100 and set mpm_prefork's MaxRequestWorkers to 70. ------------------------------------------------------------------------- -For Calculate Automatic according to your server resources and configure -mod_prefork you can Install and Execute ApacheTune - -Home Page: https://github.com/royalterra/apache2tune - -git clone https://github.com/royalterra/apache2tune.git - -cd apache2tune - -chmod +x Apache2tune.sh - -Please Read the Documentation of Apache2tune -./Apache2tune.sh +Here are you can read more information about Apache performance tuning: +https://httpd.apache.org/docs/2.4/misc/perf-tuning.html +There are tons of scripts to help you with fine-tuning your Apache installation. Just search with your favorite search engine 'apache fine-tuning script'. -- cgit v1.2.3 From 7244dfce1d935e033c70f4d00c3084cebf97d619 Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Sat, 12 Dec 2015 17:32:29 +0100 Subject: Typos --- install/INSTALL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/INSTALL.txt b/install/INSTALL.txt index b1f940908..8ca74c23b 100644 --- a/install/INSTALL.txt +++ b/install/INSTALL.txt @@ -383,7 +383,7 @@ needs MySQL access, too. A good setting for a medium-sized hub might be to keep MySQL's max_connections at 100 and set mpm_prefork's MaxRequestWorkers to 70. -Here are you can read more information about Apache performance tuning: +Here you can read more about Apache performance tuning: https://httpd.apache.org/docs/2.4/misc/perf-tuning.html There are tons of scripts to help you with fine-tuning your Apache installation. Just search with your favorite search engine 'apache fine-tuning script'. -- cgit v1.2.3 From 2aa3acae6b42ba5f7ac4d984162a9891b9c45d3c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 15 Dec 2015 19:46:24 -0800 Subject: remove deprecated table --- install/schema_mysql.sql | 9 --------- install/schema_postgres.sql | 9 --------- 2 files changed, 18 deletions(-) (limited to 'install') diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 9c24cbd94..3d7ea41df 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -772,15 +772,6 @@ CREATE TABLE IF NOT EXISTS `mail` ( KEY `mail_obscured` (`mail_obscured`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `manage` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uid` int(11) NOT NULL DEFAULT '0', - `xchan` char(255) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `xchan` (`xchan`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `menu` ( `menu_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `menu_channel_id` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 0214c0c2a..5cabbc2c9 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -767,15 +767,6 @@ create index "mail_isreply" on mail ("mail_isreply"); create index "mail_seen" on mail ("mail_seen"); create index "mail_recalled" on mail ("mail_recalled"); create index "mail_obscured" on mail ("mail_obscured"); -CREATE TABLE "manage" ( - "id" serial NOT NULL, - "uid" bigint NOT NULL, - "xchan" text NOT NULL DEFAULT '', - PRIMARY KEY ("id") - -); -create index "manage_uid" on manage ("uid"); -create index "manage_xchan" on manage ("xchan"); CREATE TABLE "menu" ( "menu_id" serial NOT NULL, "menu_channel_id" bigint NOT NULL DEFAULT '0', -- cgit v1.2.3