Joomla, XCache vs APC

Nikos's picture

Hi guys,

I have been developing a Joomla VirtueMart site on a mac and now would like to port it over to my TKL Joomla application machine. Due to terrible ViruteMart performance, it has been suggested to me that I look at tuning it performance through the use of various caching techniques. The formula I have been suggested is as follows:

  1. Use APC php bytecode accelerator - from what I have seen on the TKL Joomla manifest php XCache is already installed - however if I would like to use APC which would be the best way to do this?
  2. Use the RAM disk to load the cache files - from what I notice there is an already existing /dev/shm direcotry which means we don't have to create the ram disk ourselves - correct?
  3. Generate the whole cache every 12 hours & add the script that does this as a cron job
  4. Saving your sessions to shared memory (utilising the DB for this)

Just reference this is the website I am referencing:

Firstly I need to make sure I am porting my joomla-vm site to my TKL-Joomla app correctly. I tried just coping it as a sub-directory into /usr/share/ and then adding a Virtual Server in the Apache Webserver section in Webadmin however I am not 100% sure that this is the best way to do this.

I also notice that most of the directries in my TKL-Joomla app are all marked as belonging to the user root with usergroup root - is this correct practise even for /var/www? I would presume the joomla folder /usr/share/joomla15 would belong to the user apache user group?

If someone is also able to shed some light on how I would be able to then proceed to apply the tuning suggestions from the for mentioned site it would be greatly appreciated - I am primarily intereted in using APC rather than XCache.

many thanks

Liraz Siri's picture

Though that is the main topic I can't comment on Joomla specific optimizations because I don't really know much about that.

However, regarding APC, in my testing there hasn't been substantial difference in performance between that an xcache. They are pretty much equivalent. Are there any other reasons you are thinking of using that instead?

Also, using a RAM disk to store cached files is a poor idea. Linux disk buffering already caches any disk reads to memory for fast access, so if you have enough memory there shouldn't be a difference between reading a frequently accessed file from memory or from memory buffered disk. Ramdisk only forces the issue.

Regarding permissions, for security reasons it's usually not a good idea to give Apache write permissions to PHP code because that means any vulnerability that allows an attacker to execute code on your server as Apache would also allow him to modify the currently running application (e.g., insert a backdoor).

Post new comment