Date: 2007-05-24 04:02 (UTC)
This must be an interesting problem, because I'm still thinking about it after 1.5 days... I want to simulate a few scenarios to see if I can generate some pretty looking charts, but first I want to make sure I'm understanding your algorithm correctly. Is the following pseudocode accurate?

/*
'place' is a given range of 16 IP addresses
'lastConnect' is the last time a 'place' made a connection
'time' is the current time
'load0' is the current load on server 0
'load1' is the current load on server 1

Returns 0 or 1 corresponding to one of two webservers
*/

chooseServer( place )
{
    lastConnect = lookup_last_connect_time( place );

    if ( time - lastConnect < 20 minutes )
        return lookup_last_server_connected( place );

    else if ( load0 == load1 )
        return random( 0 or 1 );

    else
        return ( load0 < load1 )? 0 : 1;
}
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

February 2025

S M T W T F S
      1
2345678
91011121314 15
16171819202122
232425262728 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 16th, 2026 19:08
Powered by Dreamwidth Studios