Everyone needs a website

Matthew DiIulio shares a few good reasons for why “Everyone Needs A Personal Website“.  All are valid, even if simplistic:

Using social media for your web presence works wonderfully, but you don’t own and control your content. At any time your social media account could be deleted, and then your long time web presence is gone.

Seth Godin’s post “You are what you share” takes a different, deeper, world-changing approach:

Sharing an idea you care about is a generous way to change your world for the better.

The culture we will live in next month is a direct result of what people like us share today. The things we share and don’t share determine what happens next.

As we move away from the top-down regime of promoted movies, well-shelved books and all sorts of hype, the recommendation from person to person is now the most powerful way we have to change things.

I recommended blogging to everyone for years using a completely different set of reasons, varying from improved language and writing skills, through wider social and professional network, to useful memory dumping.

At the end of the day, it doesn’t really matter why you should do it.  Everyone has their own reasons.  But one thing I do agree with the gentlemen above – do have your own web presence, and keep sharing your stuff.

A Curated List of Tech Podcasts

It’s been a few month since I reviewed my podcast subscriptions.  Driving over 150 kilometers every working day gives me plenty of time to readjust my tastes and preferences.  Just doesn’t leave me too much time to actually do something about it.

Podcasts are easy to subscribe to.  Once you find the ones you like.  Finding the ones you like takes forever though.  Here’s where WP Tavern’s post “Awesome Geek Podcasts: A Curated List of Tech Podcasts” comes in handy.  Cause it provides not one, but two lists of podcasts:

  1. The best WordPress podcasts ultimate list
  2. A curated list of Awesome Geek Podcasts.

And while I’m familiar with many on that list, there’s a tonne of those that I haven’t heard, or heard about.

Any other recommendations?

Exceptions and Errors in PHP 7

An Exceptional Change in PHP 7.0” blog post describes nicely what are the changes to exceptions and error handling in the upcoming PHP 7.  Among simple descriptions, there is this reference chart:

\Throwable
├── \Exception (implements \Throwable)
│   ├── \LogicException (extends \Exception)
│   │   ├── \BadFunctionCallException (extends \LogicException)
│   │   │   └── \BadMethodCallException (extends \BadFunctionCallException)
│   │   ├── \DomainException (extends \LogicException)
│   │   ├── \InvalidArgumentException (extends \LogicException)
│   │   ├── \LengthException (extends \LogicException)
│   │   └── \OutOfRangeException (extends \LogicException)
│   └── \RuntimeException (extends \Exception)
│       ├── \OutOfBoundsException (extends \RuntimeException)
│       ├── \OverflowException (extends \RuntimeException)
│       ├── \RangeException (extends \RuntimeException)
│       ├── \UnderflowException (extends \RuntimeException)
│       └── \UnexpectedValueException (extends \RuntimeException)
└── \Error (implements \Throwable)
    ├── \AssertionError (extends \Error)
    ├── \ParseError (extends \Error)
    └── \TypeError (extends \Error)

Very handy!

Cheerleaders for techies in China

china cheerleaders

Here is something you don’t read every day:

Internet companies across China are embracing programming cheerleaders, pretty, talented girls that help create a fun work environment. Their job includes buying programmers breakfast, chitchatting and playing ping-pong with them.

According to the HR manager of an Internet company that hired three such cheerleaders, its programmers are mostly male and terrible at socializing, and the presence of these girls have greatly improved their job efficiency and motivation.

This website uses cookies

I’m running Google AdSense on this website to help me get a few cents for the hosting bill (it’s literally cents, not millions of dollars, like some of you apparently think).  Google now in compliance with EU Cookie Law requires publishers to have the cookie warning.

Please ensure that you comply with this policy as soon as possible, and not later than 30th September 2015.

If your site or app does not have a compliant consent mechanism, you should implement one now. To make this process easier for you, we have compiled some helpful resources at cookiechoices.org.

Usually, I don’t care about these things, or avoid them all together.  But since we are facing similar issues at work, I decided to run with it and see how it works and if it has any affect at all.

Gladly, I didn’t have to do any work at all.  The good folks have already implemented the Cookie Law Info plugin for WordPress, so that’s what I have now.  You have the choice to either accept the cookies, or leave the site.  I’m not going to fish out each cookie one by one and explain what it does.  Nobody cares. And if you do, you are probably here by mistake anyway.

WordPress Benchmark of MySQL server on Amazon EC2

I have a friend who is a newcomer to the world of WordPress.  Until recently, he was mostly working with custom-built systems and a PostgreSQL database engine, so there are many topics to cover.

One of the topics that came up today was the performance of the database engine.  A quick Google search brought up the Benchmark plugin, which we used to compare results from several servers.  (NOTE: you’ll need php-bcmath installed on your server for this plugin to work.)

My friend’s test server showed a rather poor 48 requests / second result.  And that’s on an Intel Core2 Duo E4500 machine with 4 GB of RAM and 160 GB 7200 RPM SATA HDD, running Ubuntu 12.04 x86-64.

So, I tried it on my setup.  My setup is all on Amazon EC2, using the smallest possible t2.micro servers (that’s Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz, with 1 GB of RAM and god knows what kind of hard disk, running Amazon AMI).

First, I ran the benchmark on the test server, which hosts about 20 sites with low traffic (I didn’t want to bring up a separate instance for just a single benchmark run).  MySQL runs on the same instance as the web server.  And here are the results:

Your System Industry Average
CPU Speed: 38,825 BogoWips 24,896 BogoWips
Network Transfer Speed: 97.81 Mbps 11.11 Mbps
Database Queries per Second: 425 Queries/Sec 1,279 Queries/Sec

Secondly, I ran the benchmark on one of the live servers, which also hosts about 20 sites with low traffic. Here though, Nginx web server runs on one instance and the MySQL database on another. Here are the results:

Your System Industry Average
CPU Speed: 37,712 BogoWips 24,901 BogoWips
Network Transfer Speed: 133.91 Mbps 11.15 Mbps
Database Queries per Second: 1,338 Queries/Sec 1,279 Queries/Sec

In both cases, MySQL is v5.5.42, running on the /usr/share/doc/mysql55-server-5.5.42/my-huge.cnf configuration file. (I find it ironically pleasing that the tiniest of Amazon EC2 servers fits perfectly for the huge configuration shipped with documentation.)

The benchmark plugin explains how the numbers are calculated. Here’s what it says about the database queries:

To benchmark your database I use your wp_options table which uses the longtext column type which is the same type used by wp_posts. I do 1000 inserts of 50 paragraphs of text, then 1000 selects, 1000 updates and 1000 deletes. I use the time taken to calculate queries per second based on 4000 queries. This is a good indication of how fast your overall DB performance is in a worst case scenario when nothing is cached.

So, it’s a good number to throw around, but it’s far from the realistic site performance, as your WordPress site will mostly get SELECTs, not INSERTs or UPDATEs or DELETEs. And then, you’ll obviously need to see how many SQL queries do you need per page. And then you’ll need to examine all the caching in play – from browser, web server, WordPress, MySQL, and the operating system. And then, and then, and then.

But for a quick measure, I think, this is a good benchmark. It’s obvious that my friend can get a lot more out of his server without digging too deep. It’s obvious that separating web and database server into two Amazon instances gives you quite a boost. And it’s obvious that I don’t know much about performance measuring.