Conversation
Notices
-
I spent some time this weekend following up on why this the KW Hackers GNU Social instance was so slow. I made several tweaks which I found around the Internet. I'll start from biggest impact to lowest impact.
0) Enable php5-fpm's "slow log" in `/etc/php5/fpm/pool.d/www.conf`. This lets one see exactly which scripts are taking a long time to execute. In my case, it was the OStatus GNU Social plugin, which I disabled quickly thereafter.
Source: http://steam.io/2014/03/17/troubleshooting-slow-loading-pages-in-php-fpm/
1) Tweak php5-fpm worker configs for lower-memory servers by adjusting several settings in `/etc/php5/fpm/pool.d/www.conf ` as follows.
```
pm = ondemand
pm.max_children = 6
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
```
2) Add caching in GNU Social's `config.php` file as follows
```
$config['performance']['high'] = true;
$config['attachments']['file_quota'] = 50000000;
$config['queue']['enabled'] = true;
$config['queue']['subsystem'] = 'db';
$config['queue']['daemon'] = true;
addPlugin('DiskCache');
addPlugin('InProcessCache');
unset($config['plugins']['default']['OpportunisticQM']);
unset($config['plugins']['core']['Cronish']);
// Uncomment below for better performance. Just remember you must run
// php scripts/checkschema.php whenever your enabled plugins change!
$config['db']['schemacheck'] = 'script';
```