Seam scalability estimation
stealman Nov 4, 2010 6:14 AMHello, I have done many estimation about scalability of my project, but still I think that some guess or advice from more experienced developers would be helpful especially because in my project I cannot use some multi-client simulators.
I will try to explain what is it all about..
Project - It is a free ajax-based web game where client manipulate mainly with buttons not forms. So not a classic form application but something like click - action - ajax response
. Client works at only ONE page most of the time where main panel
is rerendered according to navigation button clicked. I think that it is better to rerender only about 60% of page (40% is content which is always shown) than a whole page.
I have spent a lot of time and my effort to optimization and I think I have really optimized system .. but maybe still not enough. I will explain architecture now.
In my game are all players always in game ant their objects are singletons in a class which holds their static list. Only players currently logged in have their own session, but after logoff their avatar remains alive on the server side.
There are several asynchronous methods which performs user actios (actions here are in real time .. not click and done) In my whole application IS NOT ANY DB QUERY expcept one for world save (every 15 minutes). So DB queries count DOES NOT increase with number of clients. Simply I am trying to hold objects in memory as a singletons because I dont need to work with lists of hundred thousands of objects.
Codebooks - codebooks are initialized at server startup and then available as singletons AND as a parent
of some instantiated item. All items in my game (which I think will be the most numerous object) has that parrent
with static data and it is singleton for all items of same type and only a few instance-related data has this item instance on its own.
Clients just use some A4J buttons to manipulate with their avatar (doing actions, using inventory, travelling and so on so again not classic forms). Client is refreshed with A4J poll (only a little part of page) and if the situation allows me to controll object changes, then i use A4J PUSH (which is lot more effective) In total I have like 1 POLL/sec (up to 2KB response) and about 1 PUSH/sec (maybe up to 5KB, but only when something really changes else 0KB). If I have tested it on my own I have generated response code from server in amount of 2KB/sec per client.
On server-side I dont use long-running conversations because I dont have a need to it - No many-step wizards are there and I think that conversation means some overhead. Not many statefull beans per session, only about 15 with actions and 30 which are only form beans to hold selected info
. All are POJOS with Session scope.
I have done some optimizations on view-side where I dont use richfaces anymore because they render too much code .. I rather wrote my own javascripts for tooltips. Modals are still RF (last thing) but probably I will also use some other approach. I have a server filter which provides controll of caching images,js,css so no problem here.
What Am I afraid of - there are three things..
1 - Server load for processing many ajax-requests when more players log in even if no db-queries and only the mandatory amount of code rendered back.
2 - Server load for processing asynchronous things which simulates world live (no DB, no complicated operations but a LOT of simple ones) these are not connected to JSF at all.
3 - Server memory usage with 100.000 items game, 2000 avatars in world and 400 players logged in. How much memory could it need to have, I have many singletons used so there should not be terrible increment in memory usage but still I need at lead these numbers of players to make that game funny.
As I mentoined above I expect about 2000 - 4000 avatars in world (only on background, no web session) where each avatar could have something like 50 objects (but these objects are not complicated mainly primitive data types). I expect about 100 - 500 clients simultaneously which means about 1000 - 2000 requests per second (it will be the hardest problem I think because of JSF and ajax processing).
So finally .. what is your opinion ? Will be some quad-core 8GB server able to handle that game ? I need to discuss it because I have spent about 1000 hours of development by now and expect 3000hours more .. and I will be frustrated if I see it not working after all of that work and I cannot afford several servers in cluster. I hope that if optimized and not so complicated web game is done in year 2010 on quad cre GHZ many GB server that it SHOULD WORK but everywhere I read some comparisons there Seam seams to be the slowest framework in the world, thats why I am afraid because work in seam with JSF is so nice.
Thanx in advance for your opinions I will answer any possible question if someting is not clear. I ma not experienced in using s:cache tag for example and maybe it could save a lot of server load.