Friday, 25 February 2011

amazon web services

finally got around to jumping on the bandwagon and converting from a 1and1 customer over to amazon web services.  let's be honest, $100usd a month versus less than 1% of that.  it was a no brainer.  to do my part in the IPv4 running out of IP issues, by moving, I've free'd up 3 IP's!

oh well. a new chapter ... a single IP

Monday, 14 February 2011

PHP Sessions & Apache Cassandra

A week ago I had an idea to write an interface allowing PHP sessions to use Cassandra as a data store.  A benefit I quickly found is that I could rely on Cassandra to expire the sessions and not PHP session garbage collection.  nice.  

The code here and uses phpcassa as the interface to thrift.  

Sessions were given their own column family, with the row key defined as the site name.  each column is a session id with the column data being the session data.  

Works a treat.  Each time PHP session_start() is called, the expiry on the column resets back to the original value.  So, if the expiry is set to 1 hour, it's 1 hour after the last session_start() was invoked.  

Is this the right way to do it?  Good question....

Thursday, 3 February 2011

phpcassa and windows 7.

after years and years of not logging into IRC, I found myself logging in this evening and connecting to ... #cassandra ... I was having some big problems with PHP connecting to Cassandra.

In the end, you know what the problem was?


The default is to have localhost commented out.  For whatever reason, PHP on windows was unable to resolve localhost and could not connect to Cassandra.  Once this was uncommented, the flood gates opened and some phpcassa goodness arrived.

thobbs was great.  the project url, to which he is the author:

Tuesday, 1 February 2011

When is 100mbps 100mbps?

Answer:  Not sure.  We pay for 100mbps but are defo not getting it according to these results....

Test 1 -- via linksys wifi connection to ubee router (Zurich)

Test 2 -- Direct connection to ubee router (Zurich, CH) (Herndon, VA (US)) (Dubendorf, CH) (Zurich, CH)