Monday, December 20, 2010

MySQL Swapping to Disk - Swappiness to the rescue

I came across this blog post about MySQL swapping to disk. If you have issues with MySQL server swapping to disk, even with a large cache this blog post is for you.

The Problem:
MySQL server swapping large chunks of data into swap and then using reclaimed memory to cache more data.

The Solution:
Swappiness!

Swappiness defines how much a system can swap, the higher the number the more swapping happens, the number can be between 0 and 100. 0 is no swapping (we don't want that) and 100 is swap whenever possible thereby keeping memory clear.

# check current swappiness
/sbin/sysctl -a | grep swappiness

# set swappiness to something low, not 0
vm.swappiness = 1

# apply the settings right now
/sbin/sysctl -p

More Info:
http://www.incutio.com/blog/2009/11/27/mysql-swapping-resolution/

Tuesday, December 14, 2010

Tuesday, December 7, 2010

joomla contact form error 500

The Joomla contact form has been known to present users with an "error 500" message, particularly when using SEF plugins such as Artio.

If you have a missing "option" field in your contact form, you'll have to add it into your contact form template for Joomla.

Edit the file: templates/<your_template>/html/com_contact/contact/default_form.php

Add this:
<input type="hidden" name="option" value="com_contact" />

right before this:
<input type="hidden" name="view" value="contact" />

Templates should include this by default, but sometimes it's left out. Without the hidden option field you're going to run into error 500 problems.

Sunday, December 5, 2010