Monday, October 28, 2013

Make Joomla's Nextend Menu faster

If you're using Nextend's Accordion Menu for Joomla, there's a good chance it's slowing you down. Adding this simple patch to make it use cache cut down average loading time by 900 ms on a Joomla 2.5 site.

  • Open libraries/nextend/accordionmenu/treebase.php
  • Find the following part:

    function renderItem() {

  • Replace it with:
        $cache = & JFactory::getCache();
        $cache->call(array($this, 'renderItem'), JURI::getInstance()->toString());
    function renderItem($dummy=NULL) {

Thursday, October 24, 2013

Alternatives to mod_rpaf

For years, mod_rpaf has been the standard module for running Apache behind a reverse proxy. Fortunately, it's not the only one and there are alternatives.

  • mod_extract_forwarded which is available in EPEL, so it's available for CentOS systems without compling
  • mod_remoteip which is built into Apache 2.4 (but good luck finding a production server running 2.4)
  • mod_rpaf modified to support X-Forwarded-Proto/X-Forwarded-HTTPS/X-HTTPS

Tuesday, October 22, 2013

New software available: HTML5 prerender support for Joomla! CMS

Massive Scale is proud to announce its new software: HTML5 Prefetch/Prerender for Joomla!. It makes use of prerendering capabilities of web browsers like Chrome, Firefox or Internet Explorer 11 using machine learning techniques. You will learn more about prefetching, prerendering and Joomla! on the product page.

Monday, October 7, 2013

Thread creation error in Varnish

Today I installed Varnish on a pretty standard system (CentOS + WHM) and the service wouldn't start. The system log (/var/log/messages) contained the following:

Oct  7 04:15:46 server varnishd[20836]: Child (20846) Panic message: Assert error in WRK_BgThread(), cache_pool.c line 582:#012  Condition((pthread_create(thr, ((void *)0), wrk_bgthread, bt)) == 0) not true.#012errno = 11 (Resource temporarily unavailable)#012thread = (cache-main)#012ident = Linux,2.6.32-358.2.1.el6.x86_64,x86_64,-sfile,-smalloc,-hcritbit,no_waiter#012

The settings for number of processes and file descriptors in /etc/security/limits.{conf,d} were correct and it still didn't start. The problem turned out to be with stack size - I have no idea why this is happening in just this one system and works with every other centos, but the solution was as following:

1. Patch /etc/init.d/varnish adding a new ulimit call in start()

        # Stack size
        ulimit -s unlimited

2. Increase system limits in /etc/security/limits.conf accordingly

varnish         stack   soft            unlimited
varnish         stack   hard            unlimited

3. Restart Varnish

After successfully running Varnish this way, be sure to change the stack limit back to a reasonable size! Unlimited is not a very wise setting, but helps debugging the problem. Now Varnish and Joomla could happily work together.