aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/INSTALL.txt46
-rw-r--r--install/schema_mysql.sql10
-rw-r--r--install/schema_postgres.sql10
-rw-r--r--install/update.php9
4 files changed, 56 insertions, 19 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index c81510522..8ca74c23b 100644
--- a/install/INSTALL.txt
+++ b/install/INSTALL.txt
@@ -341,3 +341,49 @@ 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.
+
+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'.
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 3dab6c822..3d7ea41df 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`),
@@ -771,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 95ed9acb7..5cabbc2c9 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");
@@ -766,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',
diff --git a/install/update.php b/install/update.php
index 10ae6725e..24f4f21d5 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1160 );
+define( 'UPDATE_VERSION' , 1161 );
/**
*
@@ -1950,3 +1950,10 @@ function update_r1159() {
}
+function update_r1160() {
+ $r = q("alter table abook add abook_instance text not null default '' ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+