Bluelight Dev Development group that brought you SwiftKit

4Feb/0910

SwiftKit Statistics

One feature for SwiftKit we've always wanted to add was a way to count the current active users. We tried a number of methods a few years ago but all were unsuccessful, mainly due to not putting the proper thought required into the process. This time however, we stood back, looked at what needed to be done and took our available resources into account.

If we had a big beefy dedicated server at our disposal the implementation of such a feature would most likely of been quite trivial. A simple connection between SwiftKit and the server with a ping pong type system to validate connectivity would of been fine, then we could of just counted the number of connections and voila. The problem was we knew the number of SwiftKit users at any given time would be anywhere between 5 and 20 thousand. So we couldn't do the method mentioned above on the resources that were available to us.

Eventually we came up with a viable solution, one that would work with the resources we had. Every three minutes SwiftKit would silently load a webpage(less than 1kb) on one of our servers. This webpage contained only a script that would add an entry to our Users Online database, adding a unique id and an expire time which was the current time plus 200 seconds. Since this is done every 3 minutes we add an entry once, after that we use the unique id to update the expire time. Finally a script is run on the server every five minutes that remove any entries in the database that are less than the current time. In other words, it deletes all the expired entries.

So with this method, we finally have a way to count the number of active SwiftKit Users and not use up too many resources on our server. The SwiftKit update 1.30 was when we added it in, but no mention of it was made as we wanted to test it first. Initially there were a few problems with the database server, the main one was it kept hitting the max connection limit. A few tweaks and optimizations were made(mainly replacing Apache with Lighttpd) the server began to handle it just fine. In fact better than expected, this weekend should be interesting though as the weekends are the busiest time.

So now on the SwiftKit website you can check out how many active SwiftKit users there are. Currently at the time of writing this there are a bit over 11,000  users using it at once. For kicks we added a % of current RuneScape players figure, this figure is a little off though as the SwiftKit Users figure also takes into account those who have left SwiftKit open and are logged off.

If you are aware of a better method for counting users of a desktop application I'd love to hear about it. Obviously our method isn't mind blowing, but it seems to be working. Feel free to leave a comment or some constructive criticism if you have it.

Links:
http://www.swiftkit.net/index.php?page=stats

Filed under: SwiftKit Leave a comment
Comments (10) Trackbacks (0)
  1. This update is pretty nice but, I dont know how to get to it.

  2. Page views – not much. The news page in SwiftKit gets around 100k page views a day which means around 50-60k unique users.

    SwiftKit website only gets around ~8k page views a day, or around 5k unique visitors.

    Bluelightdev.com only gets about 300-400 visitors a day. :-(

  3. How about page-views? ;-D

  4. Sadly, no. The host I had it on null routed me as they thought I was being DDOS attacked. I tried to explain this was legit traffic but they didn’t understand.

    When I eventually get a better server I’ll sort something out.

  5. is the SK user percentage still running? I cannont seem to find the % or number or people currently using SK.

  6. SwiftKit is coded in VB6, and no it is not open source.

  7. Hi, I was wondering whether or not you code SwiftKit in C#, if so. Is it open source?

  8. Will it distinguish between inactive & active users? To avoid the logging-in-update hassle (I am on dialup) I keep SK up as much as a week at a time. I am actually only playing 2-3 hours per day on average.

  9. What about information on each client. Like how many people are listening to music, using IRC, how many screenshots have been taken with swiftkit, or what theme they’re using. I’d like to see the information on that if possible, that would be really cool.

  10. Wow nice update =D.


Leave a comment


No trackbacks yet.