Load problem - Help with server / xenforo optimization

http://www.travelstories.gr/community/threads/27956/
Fatal error: Method XenForo_Template_Public::__toString() must not throw an exception in/home/travelst/public_html/community/library/TableOfContents/Listener.php on line 0

Disable that plugin and see what is happening. Wordpress is a known performance killer.
You SHOULD move to nginx and php-fpm, install APC and php-pecl-memcached (even if you are on a single server).
If possible, get rid of all crazy panels used for server administration...

Some reading material:
http://xenforo.com/community/threads/xenforo-caching-amazing.32629/page-5#post-396980
 
Last edited:
I have already tried to disable all plugins and that thread still doesn't load. Should I try to repair the posts table or something?
 
My host replied that memache is not supported in apache version 2.4.x.

So he set me up with FCGI and APC now.

Now that I've got APC, do I need to do something in xenForo's configuration?
 
My host replied that memache is not supported in apache version 2.4.x.

So he set me up with FCGI and APC now.

Now that I've got APC, do I need to do something in xenForo's configuration?
APC should automatically start to cache the compiled PHP scripts.

You can also set it to cache the session information as well so it makes 1 less DB query per page load.
 
I have already tried to disable all plugins and that thread still doesn't load. Should I try to repair the posts table or something?
http://www.travelstories.gr/community/threads/27956/
Now, this returns an internal error, so that is progress. What do you see into web server logs?
Easiest way is to do a tailf on your log and load that page, then note where is the problem (you might want to close the forums so you isolate the issue). This is what I would do on my server:
# tailf /var/log/php-fpm/www.log
Then, I would load the page in a browser and note what is the output on the terminal.
Replace the log example I posted with your Apache log and post the error you get ONLY for that specific page, no screenshots, real text please.
 
Last edited:
I'm getting a lot of errors in my apache error log, if you check near the end you will see the errors when I tried to access this thread (it points as a referrer to xenforo.com)

Code:
[Sun Aug 04 08:40:46.887470 2013] [:warn] [pid 9577] (32)Broken pipe: [client 87.202.68.26:10514] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/
[Sun Aug 04 08:40:47.585624 2013] [:warn] [pid 9322] (32)Broken pipe: [client 87.202.68.26:10515] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/
[Sun Aug 04 08:40:52.023069 2013] [:warn] [pid 9463] (104)Connection reset by peer: [client 173.199.116.11:35624] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:40:58.483315 2013] [:warn] [pid 9597] (32)Broken pipe: [client 173.199.116.11:37745] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:41:26.361226 2013] [:warn] [pid 9322] (32)Broken pipe: [client 141.237.142.179:61464] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/
[Sun Aug 04 08:41:27.983771 2013] [:warn] [pid 9597] (32)Broken pipe: [client 141.237.142.179:61462] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/
[Sun Aug 04 08:41:37.887155 2013] [:warn] [pid 9451] (32)Broken pipe: [client 141.237.142.179:61499] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/category/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82-%ce%b5%ce%bb%ce%bb%ce%ac%ce%b4%ce%b1/%ce%9d%ce%b7%cf%83%ce%b9%ce%ac%ce%99%ce%bf%ce%bd%ce%af%ce%bf%cf%85/
[Sun Aug 04 08:41:44.968867 2013] [:warn] [pid 9711] (104)Connection reset by peer: [client 79.131.152.23:60836] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:41:51.050353 2013] [:warn] [pid 9598] (104)Connection reset by peer: [client 79.131.152.23:60926] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:41:51.104389 2013] [:warn] [pid 9142] (32)Broken pipe: [client 141.237.142.179:61521] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/category/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82-%ce%b5%ce%bb%ce%bb%ce%ac%ce%b4%ce%b1/%ce%9d%ce%b7%cf%83%ce%b9%ce%ac%ce%99%ce%bf%ce%bd%ce%af%ce%bf%cf%85/page/2/
[Sun Aug 04 08:42:17.039565 2013] [:warn] [pid 9464] (32)Broken pipe: [client 149.172.227.150:58255] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/2011/09/28/%ce%b7-%cf%84%ce%ae%ce%bd%ce%bf%cf%82-%ce%bc%ce%b5-%cf%84%ce%b1-%ce%b4%ce%b9%ce%ba%ce%ac-%ce%bc%ce%b1%cf%82-%ce%bc%ce%ac%cf%84%ce%b9%ce%b1/
[Sun Aug 04 08:42:20.782737 2013] [:warn] [pid 9710] (104)Connection reset by peer: [client 173.199.116.11:36037] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:43:07.075955 2013] [:warn] [pid 8908] (104)Connection reset by peer: [client 173.199.116.11:51231] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:43:11.109180 2013] [:warn] [pid 9596] (104)Connection reset by peer: [client 188.165.243.45:60648] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/administrator/index.php
[Sun Aug 04 08:43:19.856420 2013] [:warn] [pid 8908] (32)Broken pipe: [client 173.199.116.11:54871] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:43:25.856947 2013] [:warn] [pid 9595] (32)Broken pipe: [client 178.154.160.29:53476] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:43:52.064913 2013] [:warn] [pid 9598] (104)Connection reset by peer: [client 173.199.116.11:37706] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:44:20.149716 2013] [:warn] [pid 9451] (104)Connection reset by peer: [client 173.199.116.11:46694] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:44:40.320506 2013] [:warn] [pid 9596] [client 110.174.110.37:54259] mod_fcgid: read data timeout in 40 seconds, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 08:44:40.320707 2013] [core:error] [pid 9596] [client 110.174.110.37:54259] End of script output before headers: index.php, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 08:44:50.929112 2013] [:warn] [pid 8736] mod_fcgid: process 9735 graceful kill fail, sending SIGKILL
[Sun Aug 04 08:45:13.736623 2013] [:warn] [pid 9709] (32)Broken pipe: [client 173.199.116.11:36613] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:45:24.435367 2013] [:warn] [pid 8908] (104)Connection reset by peer: [client 173.199.116.11:40004] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Aug 04 08:46:04.430162 2013] [:warn] [pid 9598] (104)Connection reset by peer: [client 94.66.114.131:56529] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/
[Sun Aug 04 08:46:24.054211 2013] [:warn] [pid 9764] (104)Connection reset by peer: [client 188.165.243.45:49489] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/administrator/index.php
[Sun Aug 04 08:46:43.053287 2013] [:warn] [pid 9595] [client 110.174.110.37:54395] mod_fcgid: read data timeout in 40 seconds, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 08:46:43.053411 2013] [core:error] [pid 9595] [client 110.174.110.37:54395] End of script output before headers: index.php, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 08:46:51.128022 2013] [:warn] [pid 8736] mod_fcgid: process 9826 graceful kill fail, sending SIGKILL
[Sun Aug 04 08:47:39.669132 2013] [:warn] [pid 9762] (32)Broken pipe: [client 149.172.227.150:58618] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/category/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82/%cf%84%ce%b1%ce%be%ce%b9%ce%b4%ce%b9%cf%89%cf%84%ce%b9%ce%ba%ce%ad%cf%82-%ce%b9%cf%83%cf%84%ce%bf%cf%81%ce%af%ce%b5%cf%82-%ce%b5%ce%bb%ce%bb%ce%ac%ce%b4%ce%b1/%ce%bd%ce%b7%cf%83%ce%b9%ce%ac%ce%b1%ce%b9%ce%b3%ce%b1%ce%af%ce%bf%cf%85/page/3/
[Sun Aug 04 08:48:10.887797 2013] [:warn] [pid 9133] (32)Broken pipe: [client 178.154.160.29:28681] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
 
From my experience with Nginx, FastCGI should be set to have a very short lifespan. By default, is set to 500 requests in Apache. Set PHP_FCGI_MAX_REQUESTS to 100 and PHP_FCGI_CHILDREN to the number of your processors. I apologize for the lack of knowledge related to Apache, I used Nginx for last 8 years. This might help:
http://www.cyberciti.biz/tips/rhel-centos-fedora-apache2-fastcgi-php-configuration.html

Also, usually broken pipes are related to not enough memory allocated to PHP. What is the current PHP memory_limit? XenForo needs at least 128MB, but those come mostly from Wordpress code in your case.
# php -i | grep memory_limit
memory_limit => 128M => 128M
I would disable any form of cache (APC, etc.) just to get the logs cleaned of errors.

Simply put, you need to start from scratch as right now everything is chaotic on your site.
Disable Wordpress completely and have the frontpage redirected to your forums. Use a stock XenForo setup and watch closely your logs until you are error free. If you are not comfortable, hire a professional and have your server setup analyzed from ground up, as I'm pretty sure everything is a mess. Also, this should be a learning experience for you not to adventure yourself and add a gazillion of mods, thinking that everything is nice and dandy. Every forum admin should have a preprod environment where they test everything, before they move it in production. Extensive server logs analysis is crucial at this level, that's why logs are created not just to consume disk space.

Example of error logs on my live site (measured in bytes and mostly generated because code experimentation or upgrades), with Wordpress and XenForo running:
Code:
# ls -lah /var/log/php-fpm/
total 64K
drwxr-xr-x. 2 root    root 4.0K Aug  3 03:09 .
drwxr-xr-x. 9 root    root 4.0K Aug  3 03:09 ..
-rw-r-----. 1 php-fpm root    0 Dec 20  2012 php-fpm.log
-rw-r-----. 1 php-fpm root    0 Dec 20  2012 www.access.log
-rw-r-----. 1 php-fpm root    0 Aug  3 03:09 www.log
-rw-r-----. 1 php-fpm root 2.5K Aug  8  2012 www.log-20120806.gz
-rw-r-----. 1 php-fpm root  284 Aug  9  2012 www.log-20120808.gz
-rw-r-----. 1 php-fpm root  201 Aug 17  2012 www.log-20120809.gz
-rw-r-----. 1 php-fpm root  263 Aug 30  2012 www.log-20120817.gz
-rw-r-----. 1 php-fpm root  159 Sep  1  2012 www.log-20120830.gz
-rw-r-----. 1 php-fpm root  191 Oct  2  2012 www.log-20120901.gz
-rw-r-----. 1 php-fpm root  234 Oct 15  2012 www.log-20121002.gz
-rw-r-----. 1 php-fpm root  233 Dec 25  2012 www.log-20121015.gz
-rw-r-----. 1 php-fpm root  176 Feb 27 03:17 www.log-20121225.gz
-rw-r-----. 1 php-fpm root  272 Mar  4 03:45 www.log-20130227.gz
-rw-r-----. 1 php-fpm root  165 Jul 17 03:29 www.log-20130304.gz
-rw-r-----. 1 php-fpm root  186 Jul 29 03:26 www.log-20130717.gz
-rw-r-----. 1 php-fpm root  155 Aug  3 03:09 www.log-20130729.gz
-rw-r-----. 1 php-fpm root  171 Aug  3 02:56 www.log-20130803
-rw-r-----. 1 php-fpm root    0 Dec 20  2012 www.slow.log
 
Last edited:
Thank you very much for trying to help me. The php memory limit is 128mb right now.

What are all these broken pipe warnings?
 
Alright I've killed wordpress, put up a "maintenance" page for now, and I'm waiting a few minutes to check the logs...
 
Let us know, curious on your findings. :)
Did you disabled all XenForo plugins? I know your users might hate you but please try to temporarily use a stock theme and no plugins, just to nail all errors properly. If you see your logs clean, at least you know the current Apache/PHP setup is proper. Then start the dance of adding one plugin at the time and watch the logs with a tailf.
 
Last edited:
Alright I've killed wordpress, put up a "maintenance" page for now, and I'm waiting a few minutes to check the logs...
Most everything I found related to WordPress - and usually involved certain themes and/or add-ons for it.
 
Errors still coming in:

Code:
[Sun Aug 04 10:01:49.317385 2013] [:warn] [pid 857] [client 70.51.12.223:62959] mod_fcgid: read data timeout in 40 seconds, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 10:01:49.317534 2013] [core:error] [pid 857] [client 70.51.12.223:62959] End of script output before headers: index.php, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 10:01:59.133887 2013] [:warn] [pid 31864] mod_fcgid: process 13959 graceful kill fail, sending SIGKILL
[Sun Aug 04 10:02:31.224890 2013] [:warn] [pid 12331] (104)Connection reset by peer: [client 79.131.36.147:28694] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/community/threads/%CE%B5%CF%80%CE%AF%CF%83%CE%BA%CE%B5%CF%88%CE%B7-%CF%83%CF%84%CE%BF-%CE%BC%CE%B9%CE%BB%CE%AC%CE%BD%CE%BF-%CF%83%CF%84%CE%B9%CF%82-%CE%B5%CE%BA%CF%80%CF%84%CF%8E%CF%83%CE%B5%CE%B9%CF%82.44215/page-4
[Sun Aug 04 10:02:31.332609 2013] [:warn] [pid 23782] (104)Connection reset by peer: [client 79.131.36.147:28693] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/community/threads/%CE%B5%CF%80%CE%AF%CF%83%CE%BA%CE%B5%CF%88%CE%B7-%CF%83%CF%84%CE%BF-%CE%BC%CE%B9%CE%BB%CE%AC%CE%BD%CE%BF-%CF%83%CF%84%CE%B9%CF%82-%CE%B5%CE%BA%CF%80%CF%84%CF%8E%CF%83%CE%B5%CE%B9%CF%82.44215/page-4
[Sun Aug 04 10:02:31.755070 2013] [:warn] [pid 23785] (104)Connection reset by peer: [client 79.131.36.147:28687] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.travelstories.gr/community/threads/%CE%B5%CF%80%CE%AF%CF%83%CE%BA%CE%B5%CF%88%CE%B7-%CF%83%CF%84%CE%BF-%CE%BC%CE%B9%CE%BB%CE%AC%CE%BD%CE%BF-%CF%83%CF%84%CE%B9%CF%82-%CE%B5%CE%BA%CF%80%CF%84%CF%8E%CF%83%CE%B5%CE%B9%CF%82.44215/page-4
 
I've locked down the forum too, and disabled all xenforo plugins. I'll browse the damn thing myself for a few minutes and see what happens in the logfiles...
 
Do a tailf on your log and paste this in your browser (don't click on link):
http://www.travelstories.gr/community/threads/44215/

Do you get an error into log?

Once I visit that URL, I get these 3 lines in the apache logfile:

Code:
[Sun Aug 04 10:12:05.389073 2013] [:warn] [pid 24288] [client 110.174.110.37:60929] mod_fcgid: read data timeout in 40 seconds, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 10:12:05.389183 2013] [core:error] [pid 24288] [client 110.174.110.37:60929] End of script output before headers: index.php, referer: http://xenforo.com/community/threads/load-problem-help-with-server-xenforo-optimization.55151/page-5
[Sun Aug 04 10:12:11.776430 2013] [:warn] [pid 31864] mod_fcgid: process 24281 graceful kill fail, sending SIGKILL
 
Don't visit the URL, copy it and paste into your browser address bar while watching the Apache log.
You should not get an error.
 
Back
Top Bottom