Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Postby coolboy714cp » 19 Aug 2016, 04:28

Is there any way possible to make this possible:

I currently have these to work with:
1. A single 2,000 CCU SFS2X License.
2. Access to 2 servers I can run SmartFoxServer on.

On the 2 servers I actually have physical access to, I only want to have a maximum of 200 CCU on each server at any given moment. I would like to allow my users to choose which server they would like to join (only if the server chosen contains less than 200 users) after they login to their account.

If the server the user attempts to join already contains the maximum amount of 200 CCUs, I would like to return an error message back to the client.

-------------------
As many of us SmartFoxServer enthusiasts who have been using the server for quite some time now know, unless I'm way off here, my goal can be reached by simulating the process with a single server with my 2K CCU License, but rather than using multiple servers like I want to do, just use 2 Zones instead and configuring the maximum amount of users per zone to 200.

I'd just much rather use the same 2K license on 2 separate machines, rather than 1 machine with 2 Zones (it might already be possible and I'm just wasting mine and your time, I just haven't had a chance to test it yet though).

-------------------
Anyway, I'm looking forward to anyone and everyone that can let me know if this is possible (in a way I guess, basically sharing 1 license across 2 servers [although both are mine], yet limiting each server to 200 CCUs totaling only 400 CCUs with both servers containing my personally defined user count total).

If the same license can't be used in a production environment, are there any possible workarounds anyone can even think of that might even theoretically work? If not, it's somewhat ridiculous if there is no way to accomplish this task other than to either create 2 zones and call them "servers," or to buy more licenses.. But, that's just my opinion.

Thanks to anyone just willing to read this long post, and another thanks for any solutions, tips, information, help, and replies!

--

P.S. In SFS1X, you could use PHP to get a zone's user count if my memory is correct. In AS3, what is the quickest and most efficient way to do the same thing, sending AND receiving the ABSOLUTE smallest amount of bytes to AND from the server? Would it be more efficient (and which would transmit the least amount of data to/from the server?) to do this via a Jetty Servlet or a simple AS3 script?

Thanks for all your help everyone!
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Postby Bax » 19 Aug 2016, 08:08

Sharing a license between servers is not possible. If you like we can split your 2K license into two 1K license, or something like that.
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Postby Lapo » 19 Aug 2016, 08:15

coolboy714cp wrote:P.S. In SFS1X, you could use PHP to get a zone's user count if my memory is correct. In AS3, what is the quickest and most efficient way to do the same thing, sending AND receiving the ABSOLUTE smallest amount of bytes to AND from the server? Would it be more efficient (and which would transmit the least amount of data to/from the server?) to do this via a Jetty Servlet or a simple AS3 script?

SFS2X is more secure and doesn't allow this.
You can do this in two ways:

1- via Jetty, creating a servlet that you may invoke directly or remotely from another web server
2- by publishing the CCU count of each Zone you need on a database that can be later read by a web page.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Postby coolboy714cp » 19 Aug 2016, 08:59

Lapo wrote:
coolboy714cp wrote:P.S. In SFS1X, you could use PHP to get a zone's user count if my memory is correct. In AS3, what is the quickest and most efficient way to do the same thing, sending AND receiving the ABSOLUTE smallest amount of bytes to AND from the server? Would it be more efficient (and which would transmit the least amount of data to/from the server?) to do this via a Jetty Servlet or a simple AS3 script?

SFS2X is more secure and doesn't allow this.
You can do this in two ways:

1- via Jetty, creating a servlet that you may invoke directly or remotely from another web server
2- by publishing the CCU count of each Zone you need on a database that can be later read by a web page.

cheers


Hmm... Okay, what would be the best way to keep track of the CCU count of an entire server? Is there a way to get the SmartFox instance's current CCU count in a single command, or do you have to get a list of all zones, and have a for loop adding each zone's CCU count one by one? That's why I asked about the efficiency of the server's CCU count. Optimization is what I need and looping through multiple servers' zones' CCU counts isn't efficient, and can only get slower as the applications and servers are updated..

The database option is kinda pointless for the reason I need the server's total CCU count as it needs to be updated constantly and always be correct for my purposes.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Splitting License Between 2 Servers + Efficiency: AS3 vs Servlet

Postby Lapo » 19 Aug 2016, 10:04

Looping through a list of zones and summing their CCU count takes a few microseconds (millionth of a sec). I would dare say you should not worry about efficiency. :)

In any case if you had 1000s of users asking for the same piece of information you can still cache the calculated value for a reasonable amount of time such as 1-2 seconds, so that you don't keep calculating the same value over and over.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 56 guests