Author Archives: wagamama

Single Drive vs Raid 0

Every computer nerd knows RAID 0 is quick. My most recent computer (now about 1 year old) I put in three SSD drives operating in RAID 0 – I wanted quick.

I had an extra drive come out of another machine so I stuck it in there, but as a stand alone drive where I just put temporary files etc.

I was doing some reading today about different raid levels and performance. If you need redundancy RAID 10 seems to be the fastest option so that is what I will be using in my next batch of servers.

I never bothered to benchmark them before, I just knew that RAID 0 was faster. Is there an actual difference? Lets find out.

Performance of single SSD

The single SSD maxes out with a write speed of 138MB/sec with a read speed of 276MB/sec. That is quite snappy. I’ve seen laptop hard drives that can only do in the 12MB/sec, those laptops are painful to use.

Performance of three SSD in RAID 0

RAID 0 with three SSD disks. A max write speed of 1205MB/sec and a max read speed of 1552MB/sec – incredibly fast!

Interesting how the write speed closes the gap when you have multiple disks. Bottom line, running disks in RAID 0 does make a considerable difference! Even more interesting is how the performance increased by more than three times!

I used the free benchmark software from ATO Tech to do the testing.

RAR & UNRAR on Linux

Seems linux people don’t like RAR very much, it is not easy to install from most package managers it seems. Some used to have it, then removed it because it was not free.

Then some people come up with limited free versions etc. etc. I ended up just getting it direct from the source @ rarlab.

Move to your tmp folder and download from rarlab site.

cd /tmp
wget https://www.rarlab.com/rar/rarlinux-x64-5.8.b1.tar.gz

Extract the downloaded file (extracts to rar folder).

tar -zxvf rarlinux-x64-5.8.b1.tar.gz

Move the files to your /bin folder so you can execute rar and unrar from anywhere on your system.

cp rar/rar rar/unrar /bin

That’s about it. Now you can actually use the full power of rar on your linux box.

PHP 5.3 still shipping with DirectAdmin

PHPI don’t know why but DirectAdmin still rolls out with PHP 5.3 which was released in June 2009. It is now June 2014, how about an upgrade?

You might not want to jump to PHP 5.5 because it deprecates a bunch of the ‘old way’ of connecting to mySQL.

But is it safe to move to 5.4? If you want to find out and are running DirectAdmin, you can update with custom build like this:

cd /usr/local/directadmin/custombuild
./build update
./build set php5_ver 5.4
./build php n

Is your system still going to work? Guess you will have to upgrade and find out.

If you had installed any extensions that you compiled, odds are good they will no longer function because they were compiled for another version.

I ended up having to redo LDAP (which I compiled right in) and I had to redo APC and memcache as those were broken as a result of the PHP version upgrade.

To quickly fix memcache I just did the following to commands

pecl uninstall memcache
pecl install memcache

SSL & Server Name Indication

I recently put a request in to one of the datacenters where I have servers for an additional IP address. Of course they ask what is it for?

An SSL website was the reply…

I got back a note that we do not provide additional IP addresses for SSL anymore.

HU?

So there must now be a common way to put SSL on a shared IP, news to me.

Turns out it is called Server Name Indication which allows the hostname of the request to be included in the SSL handshake.

Turns out you can do it with DirectAdmin can do it, with a bit of tweaking. Looks like I will be putting SNI on my list of things to test.

QNAP & Cron – How To Persist A Reboot


QNAP makes a nice line of NAS machines. I had one that the power supply died on it after only a few weeks but other than that have never had an issue with any of them in service.

Not everything is so straight forward on them however, especially cron. If you have done any work on a Linux box you have encountered cron. Most people edit cron jobs using a web interface for their hosting company, but QNAP boxes are not hosting companies… You would probably try crontab -e to edit the list of jobs right?

Problem is, changes you make do not persist across reboots. A real pain-in-the-butt if you forget that and reboot to find out your jobs are not running like you thought they were.

The trick is you must directly edit /etc/config/crontab file, make your changes there and they will then persist across reboots OK.

QNAP has done a WIKI page about editing cron jobs on their website.

Oh no, Microsoft says Windows 2003 is dead!

windows-server-2003Microsoft has announced July 14, 2015 as the end of support for Windows Server 2003. Since there will be no support, patches, or security updates for your servers running Windows Server 2003 you might find yourself between a rock and a hard place.

I for one still have production servers that are running Server 2003, it has proven to be a very stable operating system for some systems.

If you still have systems running 2003, you might want to start planning your upgrade path. Leaving 2003 systems in production past the end of support could leave you with your pants down.

Tuning MySQL with mySQLTuner

Ok, so I’ve got a MySQL database… it is on a dedicated server – a cheap one. Only has 2gig ram and a low end i3 processor. It is running on a Unix based system and the performance is not very good.

Problem is the dedicated server is paid up for another 1/2 year, so I want run out the contract and move to a bigger box after the contract runs out.

I started doing some Googling (is that a word?) to locate information on tweaking MySQL.

Came across an excellent bit of kit called mysqltuner. Easy to install with apt-get or yum as it is available as a package (mysqltuner). Then just execute mysqltuner and provide the admin login/password for the local server.

I knew the server was not setup correctly, but no idea what needs to be adjusted. The sql server needs to run for at least 24 hours to get a baseline of what needs to be adjusted.

I made a few small adjustments (reducing max connections, which sucks up way too much ram) and have restarted the server. Will run the command again after 24 hours and make a few more of the suggest changes. Nice piece of software, if you are looking to tweak your MySQL – do check it out.

mySQLTuner

You can see in the image that the server has been running for 180 days, 88% of the usage is writing and the maximum number of connections at one time to the server during that time has been 619 simultaneous connections.

However because the performance of the slow performance of the machine we moved most of the clients off the box so we have reduced the maximum connections down to 100 which saves a lot of ram.

The funny part I see is the databases consume 45.7gigs currently and the tools suggests a buffer_pool_size of more than 45gigs. That means the SQL server could run 100% out of RAM, sorry mySQL that isn’t going to happen on this server 🙁

Dyn Kills Free Hostname Program

I recently got some email from Dyn, something about their free hostname program being canceled.

I honestly did not think about it and just deleted the message, for a couple of reasons:

1) I’m not using their hostname program
2) I have a grandfathered free Dyn account from WAY back in the day

Then today I got another email, as seen here.

dyn

The part that stuck out to me was “If you are receiving this email, you have one or multiple free hostnames with us.”

Hmmm, if they are saying I have a free hostname let me think about this a bit more. Oh yea, I do use their DynDNS service – is that what they are taking about?

Should not impact me, I am on the grandfathered free account. Then I noticed the note in the email that says if you are a paid customer (which I consider myself to be) that this free hostname service would no longer be free. A Google search led me to a blog post by the CEO, which explains a bit more – basically they feel people are abusing it.

Dam! What’s a guy to do???

I run a few servers with Simple DNS Plus, which fortunately supports dynamic DNS updates.

It was very easy to setup, in fact the Dyn Updater software the Dyn distributes is actually developed by KanaSolution and they have the unbranded version of the software the Dyn uses available as DynDNS Updater.

I just removed the Dyn version and went with the unbranded one. So far so good.

I logged into my account and I don’t see any mention if my DynDNS is being canceled or what. At least now I don’t have to worry if Dyn is going to be canceling my free service since I am no longer relying on them for the service (it did work well while it lasted, thanks guys).

PHP Magic Quotes – A Thing Of The Past

I’ve got a few DirectAdmin servers running, anytime someone inserts data into the database I either escape the incoming data or use parametrized sql (better way).

If you find you insert something like Mr’Toad and you end up with Mr\’Toad on your screen you probably have one or more of PHP magic quotes enabled. Check your php.ini file and if you have one or more enabled turn them off.

A lot of systems will no longer run if they are enabled and as of PHP 5.3 they are DEPRECATED. If you happen to be using PHP 5.4 you will find they are totally REMOVED so don’t rely on them!

You will want to ensure you have lines in your php.ini showing they are off:

; Magic quotes are a preprocessing feature of PHP where PHP will attempt to
; escape any character sequences in GET, POST, COOKIE and ENV data which might
; otherwise corrupt data being placed in resources such as databases before
; making that data available to you. Because of character encoding issues and
; non-standard SQL implementations across many databases, it’s not currently
; possible for this feature to be 100% accurate. PHP’s default behavior is to
; enable the feature. We strongly recommend you use the escaping mechanisms
; designed specifically for the database your using instead of relying on this
; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is
; scheduled removed in PHP 5.4.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/magic-quotes-gpc
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
; http://php.net/magic-quotes-runtime
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ‘ with ” instead of \’).
; http://php.net/magic-quotes-sybase
magic_quotes_sybase = Off

If you have any doubts about your system settings, check phpinfo();

Focal Length

Going bird hunting this weekend, so I got myself a big gun. The Canon 70-200mm f/2.

I also got the 2x tube (or whatever it is called) to get as close to the birds as I can.

So how close is close?

All photos were done on a Canon 7D, which uses a 1.6x crop sensor so the photos should be 1.6x more zoom than if it was shot on a full frame camera.

I snapped some shots at different focal lengths to see. My target for these sample photos was a construction crain, specifically the driver control box. Here are the results (click for larger image).

Construction Crain @ 15mm
Construction Crain @ 50mm
Construction Crain @ 50mm
Construction Crain @ 70mm
Construction Crain @ 200mm
Construction Crain @ 200mm
Construction Crain @ 360mm

I’ve always thought 200 x 2 would be 400, but apparently not. With the 2x adapter on the 70-200mm lens the EXIF data is reporting the final shot is actually taken with a focal length of 360mm.