What is a Ram Disk you ask? Simply put, you carve out a piece of your system’s RAM and use it as a normal file system. But you probably have some more questions…

Why would I want to do this?

Simply put, RAM is very fast. Faster than most (any?) SSD drive. So if you have an application that would benefit from being able to access data very quickly, a RAM disk makes a lot of sense.

That’s amazing… why don’t I just load everything into a RAM disk all the time?

Two primary reasons… First… RAM is expensive and therefore quite scarce compared with conventional hard drive space. So your system probably has a fairly limited amount to work with. Second, and perhaps more critical, RAM is erased whenever power is lost. So if you do a system reboot, or lose power, everything stored on your RAM disk, even the RAM disk itself, is completely lost.

Oi’ that’s bad… when exactly would I want to use a RAM disk then?

Some applications, like MySQL for example, write “temporary” files to disk. These are usually pretty small files that are built on the fly for normal operations. Think of them like a scratch-pad you would use when doing a long equation in Algebra class. These files are built on the fly to store some temporary data (perhaps a specific view of the database as requested by a website page). Often they are used for “cache” as well, i.e. rather than taking the CPU through the task of building as special table from existing tables again and again, it caches the special table so it can serve it the next time it is requested.

Ultimately, if your system gets rebooted, you really don’t care if you lose this kind of data. Furthermore, having this kind of data written to and pulled from a RAM disk, could really improve application performance depending on your use case.

In this article, I am going to talk about building a RAM disk on the fly, and telling MySQL to use it. Furthermore, we are going to create a few scripts to make sure our RAM disk is created at every boot so that MySQL can consistently take advantage of it.

My Apache administration skills are something that I am working on – ongoing. Furthermore, any IT / Web / Linux admin worth their salt should have somewhat of a handle on DNS and on Apache. I have somewhat of a handle on both, though like most things I am not an expert :), rather I am always a professional generalist (always getting a little better at everything…). So when a client came to us with a scenario recently I had to do some searching around to figure out what the best solution was. I am not stating that this IS the best solution or best practice however it is working well for us and I would love to hear some ideas, if you have them, on how you would have solved this.

So basically our client built a site. Let’s call it widgets.com. However, after this site was around for several years and garnered some decent traffic they realized they really wanted it to be called coolwidgets.com and they were rebuilding the thing anyhow. That being said, they didn’t just want to outright drop “widgets.com” as, hey, that is getting some traffic and people think of this client as both “widgets” and “cool widgets” so they would really like to keep both names but always redirect to coolwidgets.com.

Google Authenticator, and (all?) other rotating-pin multi-factor authentication systems, rely on the clock on the token device (in this case your smart-phone or tablet) and the authenticating system (in this case the OpenVPN server). If the clocks are different by more than a few seconds or so, it will break your authentication. (more…)

Thought I would post this one quickly…

Having trouble getting OpenVPN to start/work for you and you are seeing this error in your logs?

“TCP/UDP: Socket bind failed on local address”

The resolution is pretty simple. Try changing the port you have assigned to openVPN in your config file and restarting the service. Most likely you have bound it to a port already being used by another service. I ran into this problem because I tried to use port 443. I wasn’t running an SSL/HTTPS website on my server but what I had forgotten that I was running SSH through 443 temporarily.

It is generally good practice to use a port above 1000 for odd services if you aren’t using the default port for said service. I run into this a lot as I don’t like to use common ports as they tend to get targeted more often and hammered by bots/evil people trying to break in…

Anyhow, hope this helps!

I thought I would put this together quickly because in typical Linux fashion something that should be straightforward isn’t… Node.js – I am still not sure what it is :), however I am in the process of setting up drupalchat on one of my sites and when I tried using it with the AJAX option, which worked well for a couple of users, it made the site run extremely slowly. The server has plenty of grunt… dedicated Ubuntu 13 VM running 3 cores and 2 GB of RAM and this particular site was the only thing running on it. Furthermore, the MySQL database server was/is on a separate dedicated VM… so there is no way it was a lack of firepower. DrupalChat running with AJAX was causing problems. I am going to launch a fuller tutorial on getting drupal chat setup but I figured I would do the node.js thing here and now….