Tuesday, November 21, 2006

Ruby and SDL again.. now I am finally getting time to write my game

So, I have had an on going dream project.. writing a game in Ruby... I first started this years ago, and it was an ambitious project, a multiplayer online virtual world.. pretty much what everybody starts out trying to do.

Then I got a new job in London, and it all went to pieces. Now finally I am picking it up again, with a careful plan.. start with something simple, and finish it, creating a game engine and getting a feel for things in the process, then move on to something more complicated, finally finishing with my multiplayer online game.

Of course the whole operation is great fun, as I am working with ruby, and SDL seems to do a pretty decent job in terms of coping with all the different OS platforms out there. Yes, you would be right in thinking that in-game art is going to be the toughest part of this! I have no graphical talent.

Progress is good, I am calling the project Spacewars for now, and it is based on a game I played when I was about eight years old on an Amstrad CPC. For more information checkout www.rossputin.org/projects/.

Friday, November 10, 2006

I am setting up my own dedicated server, its fun for a geek!

As mentioned in my previous post, www.rossputin.org (down at the time of this writing) is moving to my new dedicated server, and this is opening up a whole new world to me, involving hosting my own DNS, when previously I could only work from the Apache stage onwards. I have always classified myself as a software developer/architect, so doing these sys admin type of tasks is new ground, but definitely informative.

Of course because this is my own server (well, shared with a colleague at work) and these websites are my own.. I am striving to crank the maximum performance possible out of them. Its good fun actually... benchmarking for speed and seeing exactly what kind of performance I can get out of them!

The server will be cranking out plain old html pages, and pages served from a Cocoon instance. I am going to list some benchmark results from both here. First up, with no caching.

Plain html

using Apache Benchmark with 100 consecutive requests, we get:

Requests per second: 1155.13
Time per request : 0.866

(fast as expected, its just html)

Home page of Cocoon App

same apache command:

Requests per second: 110.51
Time per request : 9.049

(not so fast, of course.. as expected)

So I am prepared to accept 110.51 requests per second in consecutive tests.

Now lets look at some more serious stress testing :-)

Lets look at concurrent requests...

ab2 -n 10000 -c 50 http://www.my-non-cached-website.com/

will run 10000 requests with 50 request concurrency :-)

The results on my cocoon instance behind apache are:

Requests per second: 172.98
Time per request : 289.045

Now once again, clearly this is fast enough for a hobby homesite.. by why make the server do any more than it needs to, why overwork Cocoon, content is hardly changing very often.

Lets plug the caching in and repeat the tests :-)

Same ab2 command... ab2 -n 10000 -c 50 http://www.my-cached-website.com/

Wow!!!!!!

Results on cocoon instance behind apache:

Requests per second: 1602.96
Time per request : 31.192

Sweeet!!! Apache is very cool.

Thursday, November 09, 2006

So finally, after trying 'Ruby on Rails' on for size...

I have officially ditched it....

Ruby is arguably the best programming language on the planet right now, superbly crafted, but it can do a great deal better than Rails for a web platform. I gave it a decent try, but too many aspects just do not fit, particularly the templating language. All in all these nuances just seem to be geared to get you up and running as fast as possible, great for beginners, but the minute you look under the hood, you are faced with an increasingly unpleasant picture.

So I am pushing my website Rossputin.org across to Cocoon on my new dedicated server.

Talking to the guys in the Cocoon community, this seems to be the general trend. A brief 'fall in love' with Ruby on Rails, followed by finding a lack in power and in some cases sanity, followed by ultimately returning home to those 'other' frameworks out there.

One to watch out there in my opinion is certainly Wicket.