Gone static

Update 2: Looks like page load times, at least as reported by Pingdom, went up from what they initially were. In my own testing cached pages still load in something like 150 to 250 milliseconds but Pingdom disagees. I don't know if this is regular CloudFront performance fluctuation, some kind of impedance mismatch between Pingdom and CloudFront or "something else".

Update: That really did the trick and the estimated -90% page load time wasn't that far off:

Having been fed up with wastefulness (resource wise) and general slowness of the MySQL/PHP/WordPress/CloudFlare setup for some time, I have now moved this site to S3/CloudFront. Site is generated from an XML file (which I derived from a WordPress export dump) with a Python script that is hosted here. Commenting is obviously impossible but if you for some reason need to contact me you'll find contact details on your left.

Tagged with:

Categorised as:


Daily MySQL database dump, back up to S3

I'm in the process of, or planning at least, ditching MySQL/WordPress/CloudFlare and moving to a static site hosted on S3/CloudFront. At the moment, as AWS Route 53 does not support S3 or CloudFront as an Alias Target, moving to S3/CloudFront means that I have to have an A record pointing to a web server somewhere, which in turn redirects the request to the actual site's CloudFront CNAME. I do have such a server (running Nginx), but the same thing could be as well achieved by using a service such as Arecord.net. This redirect means that there's no way to run a site without the www.-prefix. Which I can live with. Also, at the moment, no SSL support is available but I'm sure I can live with that too as WordPress is simply slow, and most of all a big waste of resources. Getting rid of all the dynamic parts (seriously, it's not like there are a lot of commenters around here) will make this thing run fast, at least compared to what page load times currently are. My tests show that CloudFront returns cached pages in less than 200ms.

So, I'm killing one extra server in the near future and putting these snippets here for my own possible future use.

~/.my.cnf:
[client]
user = usename
password = password
host = hostname

[mysql]
database = dbname 
<dir>/wp-db-backup.sh:
#!/bin/sh

DBFILE="<dir>/dbname-`/bin/date +%s`.gz"

/usr/bin/mysqldump --quick dbname | /bin/gzip -c >$DBFILE
/usr/bin/s3cmd put $DBFILE s3://bucketname/
/bin/rm $DBFILE
crontab:
45 3 * * * /usr/bin/nice -n 20 <dir>/wp-db-backup.sh >/dev/null 2>&1
 

Tagged with:

Categorised as:


Blogging activities migrated to Async.fi

Installing Wordpress and getting the basic settings straight was, all and all, a relatively painless experience. One downside of choosing this particular blogging platform is that I now have to run a MySQL server just for this purpose (I have no intention to use MySQL for anything else as I have actively tried to steer away from RDBMSs, even before this whole "NoSQL" thing became fashionable). I would've preferred to be able to run Wordpress on top of an SQLite backend, just because that would've kept things one step simpler, but I just could not get the "PDO (SQLite) For WordPress" adapter to work with a reasonable amount of work, so I gave up and went ahead with a MySQL server install. So it's a tradeoff (what isn't?) but with all these plugins and stuff and whatnot that this system supports I think it's a pretty good deal. I went through the old posts at sivuraide.blogspot.com and imported what I thought I might find useful at least to some extent. Unsurprisingly not too many of the old posts fall to this category. Then again, the old blog is titled Code Notebook. The old posts did not "just work" in all places, a quick eyeballing revealed some glitches that need to be ironed out. I installed the following plugins in addition to what was bundled:

Tagged with:

Categorised as: