Category: Theory

  • Mysql Uptime Check Script

    I’ve been pretty vocal recently over my move to Amazon EC2 and switching to LEMP stack and then switch to a LEPP stack.  This has certainly seen some great improvements in speed, traffic, and Google indexing.  Unfortunately as many of you may know who run their own dedicated server, it’s not all white sandy beaches and beautiful sunsets!  When something goes wrong, it’s up to you to fix it.

    So far the only issue that I see keep cropping up is my Mysql database seems to crash every several days.  From what I can see, it appears to be a lack of memory issue – it appears my EC2 server is just shy on a bit of memory.

    At this point, I don’t think it’s worth upgrading; instead I’ve built a simple Mysql uptime script that will ensure it’s always running for me.

    (more…)

  • Upgrading my Blog – The Final Saga!

    Several of my recent posts have been discussing my recent move to Amazon EC2 and updating, first to a LEMP stack, and then to a LEPP stack, which all provided great speed increases.  However, can you really be satisfied with a slightly faster loading WordPress blog, especially when my CPU was dying regularly with 100% usage?  I certainly couldn’t, especially when YSlow was giving me such a bad rating that I had really no control over…

    Firstly, a big shout out must go to Nesbot.com; he was so kind to share his custom blog code that he built using SlimPHP.  Of course I had to add a few features myself – including my fancy Twitter slider – and an importer from my WordPress blog into this new blog structure.

    If you look at the screenshot to the right, you can see  exactly when I switched two other sites to use this code on the 22nd of September!

    (more…)

  • Update: It Actually Should Be LEPP Not LEMP or LAMP!

    In several recent posts: It’s LEMP not LAMP! and Amazon EC2 Shoutout! I’ve discussed how I switched from a shared hosting account with GoDaddy to a dedicated Micro instance with Amazon.  At the same time I decided to go out and try nginx (pronounced Engine-X) and remove Apache from the equation.

    This saw some incredible results.  However, several times since switching I’ve run into several database issues where it appears Mysql runs out of memory!  Performing a top command shows over 15 mysql processes running at anyone giving time each taking up to 10% of the memory.  On a micro instance I only get 600mb, so this adds up quickly!

    (more…)

  • A Short Rant About Coding Conventions

    Yesterday’s article actually got me a little amped up about coding conventions – Comparing a while loop against a foreach loop of an array – because I never thought I would actually have to do a comparison between a while loop and a foreach loop on an array!  If we go back and revisit the post, I was reviewing a recent CakePHP commit for an optimization on the Hash class.  The code in question is three separate blocks of code that leverage the array_shift function to get the next value in the array with a foreach loop instead.

    (more…)

  • What I Learned This Summer

    Well – it’s Friday and all of the kids are back in school.  While this post is being published, I’m probably stuck in traffic!  I can’t believe it’s a new school year already, luckily my kids aren’t old enough so it’s just traffic that I need to get used to.

    This has been a great summer so far and I thought it would be a good idea to summarize the variety of things I’ve learned about – but have not necessarily blogged about…

    (more…)