Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Send x% of the users to A, the rest to B

by ltp (Sexton)
on Oct 28, 2012 at 11:30 UTC ( #1001263=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Send x% of the users to A, the rest to B
in thread Send x% of the users to A, the rest to B

Alternately, you could use the IP address of the user (assuming it is available). There's several ways in which you could use the IP address for this, the easiest of which may be to take the modulo of any combination/all/one of the octets.

You could even then ensure you get some sort of consistency in approach for users on the same network by determining the network class, and then taking the modulo of the network portion of the IP address only. Hence users on the same network (even those with DHCP addreses) would always go to the same destination.

You'll never get a perfect 50/50 spread with this approach, but you'll get a fair spread.


Comment on Re^4: Send x% of the users to A, the rest to B

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001263]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2014-09-18 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (105 votes), past polls