• (cs)

    Oh, one more thing - the download page encourages you with pulsing pink text to read the EULA before installing. A sentiment I happen to agree with in all cases, pulsing text or not.

    I didn't see it posted on their site, so I copied the EULA from the installer and posted it here for your reading pleasure: https://thedailywtf.com/images/14/Super_EULA.rtf

    Now, I don't encourage you to do as I did and download the installer just to read the EULA, but I do suggest that you check out the section marked "Privacy" to see why.

  • Walky_one (unregistered)

    Wow... just Wow....

    Somehow I almost expected it to be followed by something like "It's possible that some of these 3rd party products include trojans, viruses and spyware" or "Uninstalling Super will wipe your hard disk"...

    +1 that they try their best to get the users to read that stuff before they install it -1000 that they actually mess with your installations without further confirmation

  • (cs)

    I should have been a switch statement....that's TRWTF.... isn't it????

    <ducking and running>
  • Walky_one (unregistered)

    Additional +1 for using groups of 3 lines for 4 servers...

    Let me think:

    1. Create a version with only 3 servers. Copy paste groups and update the "second" value.
    2. Introduce a fourth server. Insert URL at 4th position. Select first URL, paste to 5th position. Select Second URL paste to 6th position, Repeat...
  • Kasper (unregistered) in reply to Walky_one
    Walky_one:
    Somehow I almost expected it to be followed by something like "It's possible that some of these 3rd party products include trojans, viruses and spyware"
    They did tell you that in the EULA, they just worded it slightly different.
    Walky_one:
    "Uninstalling Super will wipe your hard disk"...
    They did not say that, but the EULA did say roughly this: In order to uninstall Super, you must wipe your hard disk. Though they did not word it that clearly.
  • Mike (unregistered)

    Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No

  • Career choiecs (unregistered) in reply to TheCPUWizard

    I don't know. Why do you feel you should have been a switch statement? Or can't you make up your mind?

    Captcha: valetudo - I was almost the valetudo at my high school, but they switched the grade criteria at the last moment.

  • Walky_one (unregistered) in reply to Mike
    Mike:
    Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No

    if (a = 0) UseServer1; else if (a = 1) UseServer1; else if (a = 2) UseServer1; else if (a = 3) UseServer1; else if (a = 4) UseServer1; else if (a = 5) UseServer1; else if (a = 6) UseServer1; else if (a = 7) UseServer1; else if (a = 8) UseServer1; else if (a = 9) UseServer1; else if (a = 10) UseServer2; else if (a = 11) UseServer2; else if (a = 12) UseServer2; else if (a = 13) UseServer2; else if (a = 14) UseServer2; else if (a = 15) UseServer2; else if (a = 16) UseServer2; else if (a = 17) UseServer2; else if (a = 18) UseServer2; else if (a = 19) UseServer2; else UseServer3;

    This works too... I still would qualify it as a WTF.

  • (cs) in reply to Walky_one

    % what does that do?

  • (cs)

    Maybe with all the money they spend paying for all those domains they could buy a loadbalancer?

    Also, there are a bunch of OSS load balancers out there, so a it's not that expensive either.

    Anyway, it's funny and truly a WTF since those are the words that will come out if you find this for the first time.

  • Kabi (unregistered)

    I was rather disappointed that these URLs really point to different IP addresses. Based on this code, I expected that the requests for these adresses are all handled by the same server again...

  • me (unregistered)

    so.. i can saftly assume that they don't use any cookies

  • faoileag (unregistered) in reply to Walky_one
    Walky_one:
    Mike:
    Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No

    if (a = 0) UseServer1; else if (a = 1) UseServer1; else if (a = 2) UseServer1; else if (a = 3) UseServer1; else if (a = 4) UseServer1; else if (a = 5) UseServer1; else if (a = 6) UseServer1; else if (a = 7) UseServer1; else if (a = 8) UseServer1; else if (a = 9) UseServer1; else if (a = 10) UseServer2; else if (a = 11) UseServer2; else if (a = 12) UseServer2; else if (a = 13) UseServer2; else if (a = 14) UseServer2; else if (a = 15) UseServer2; else if (a = 16) UseServer2; else if (a = 17) UseServer2; else if (a = 18) UseServer2; else if (a = 19) UseServer2; else UseServer3;

    This works too... I still would qualify it as a WTF.

    Exactly.

    You have three choices evenly distributed over 60 trigger integers? Use modulus.

    And Walky_one's solution is a wtf because it would be better written as

    if (a < 10) UseServer1;
    else if (a < 20) UseServer2;
    else UseServer3;
    

    And that's apart from the WTF of implementing a load balancer in JavaScript. That just balances the load of the AJAX requests but not the load of the page requests.

  • MB (unregistered) in reply to Mike
    Mike:
    Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No

    Statistically the load will be pretty much balanced probably.

    However, a load balancer must also exclude unavailable nodes, which this JS obviously does not do. So if 'http://www.erightsoft.info' is down, and you came at second "0", then you are out of luck even if all other servers work. A real load balancer just sends your request to a working server and marks the node down until it starts working again.

  • faoileag (unregistered) in reply to Mark Bowytz
    Mark Bowytz:
    Oh, one more thing - the download page encourages you with *pulsing pink text* to read the EULA before installing. A sentiment I happen to agree with in all cases, pulsing text or not.

    I didn't see it posted on their site, so I copied the EULA from the installer and posted it here for your reading pleasure: https://thedailywtf.com/images/14/Super_EULA.rtf

    Now, I don't encourage you to do as I did and download the installer just to read the EULA, but do suggest that you check out the section marked "Privacy" to see why.

    Actually, aren't you braking their EULA by posting it on TDWTF's website?
  • dgschrei (unregistered) in reply to Mike
    Mike:
    Is it elegant> No Does it work? Probably Is there a problem? Probably not It is a wtf? No

    It does not work. At least not like a usual load balancer. As the article correctly states one of the advantages of a proper load balancer is that if one of the servers fails the others will transparently take over the load of the failed server (assuming the load doesn't overwhelm them of course) .

    With this implementation, if one of the 4 servers fails 25% of all download requests will time out and not be served. That's why you can not put the logic for load balancing into the javascript of your page. Then the client decides how he wants to "balance" the load. Without any knowledge of the situation on the other end of the line this is utterly useless. And that's the wtf.

  • Joey (unregistered) in reply to Walky_one

    var d = new Date(); var n = d.getSeconds();

    if(n <= 20) UseServer1; if else (<= 40) UseServer2; else UseServer3;

    The Code being wtfee is just the icing. I think even if it was coded cleanly the fact of the matter is that load balancing hardware is a superior solution and anything done in JavaScript is a hack.

  • anon (unregistered) in reply to Mark Bowytz

    Ohhh, it's SUPER. I remember SUPER. The GUI wrapping ffmpeg commands with boat loads of adware. The WTF code kind of makes sense given that it's from an adware vendor.

  • Antonio (unregistered)

    More simple and... clever?

    var Digital=new Date(); var sec=Digital.getDay(); var rslt1= (sec);

    if (rslt1== 0) {domain1 = 'http://www.erightsoft.info';} else if (rslt1== 1) {domain1 = 'http://www.erightsoft.biz';} else if (rslt1== 2) {domain1 = 'http://www.erightsoft.org';} else

    if (rslt1== 3) {domain1 = 'http://erightsoft.podzone.net';} else if (rslt1== 4) {domain1 = 'http://www.erightsoft.info';} else if (rslt1== 5) {domain1 = 'http://www.erightsoft.biz';} else

    if (rslt1== 6) {domain1 = 'http://www.erightsoft.org';} else

    document.write("<iframe width='88%' height='400' noresize scrolling='no' frameborder='0' marginheight='0' marginwidth='0' SRC='"); document.write(domain1); document.write("/S6Kg2.php'> </iframe>");

    Captcha: eros (refreshed to nobis)

  • Antonio (unregistered) in reply to Antonio

    OK I did a mistake, forget about last else

  • Gechurch (unregistered) in reply to Joey
    Joey:
    if(n <= 20) UseServer1; if else (<= 40) UseServer2; else UseServer3;

    Although your code is much cleaner, it does defeat the purpose as it will send all requests to one server for a 20 second period, which the other servers sit idle.

    Modulus is the solution to that part of the WTF (ignoring the bigger part - that having a 'load balancer' that will happily send requests to a server that is down is defeating the point).

  • A Guy (unregistered) in reply to Walky_one
    Walky_one:

    if (a = 0) UseServer1; else if (a = 1) UseServer1; else if (a = 2) UseServer1; else if (a = 3) UseServer1; else if (a = 4) UseServer1; else if (a = 5) UseServer1; else if (a = 6) UseServer1; else if (a = 7) UseServer1; else if (a = 8) UseServer1; else if (a = 9) UseServer1; else if (a = 10) UseServer2; else if (a = 11) UseServer2; else if (a = 12) UseServer2; else if (a = 13) UseServer2; else if (a = 14) UseServer2; else if (a = 15) UseServer2; else if (a = 16) UseServer2; else if (a = 17) UseServer2; else if (a = 18) UseServer2; else if (a = 19) UseServer2; else UseServer3;

    This works too... I still would qualify it as a WTF.

    odd definition of 'works': always going for Server1

    (or are the '=' just 20 typos?)

  • anonymous (unregistered) in reply to Gechurch
    Gechurch:
    Although your code is much cleaner, it does defeat the purpose as it will send all requests to one server for a 20 second period, which the other servers sit idle.
    Considering that the clock being used is the users', which will vary widely even for side-to-side computers, it wouldn't make much difference.

    But as long as it is implemented in JS, it IS a WTF!

  • the beholder (unregistered) in reply to Kasper
    Kasper:
    Walky_one:
    Somehow I almost expected it to be followed by something like "It's possible that some of these 3rd party products include trojans, viruses and spyware"
    They did tell you that in the EULA, they just worded it slightly different.
    I completely agree with Kasper. If you can't realize there's a "promise" of malware in that text you really need to educate yourself on EULA interpretation. Ditto on the need for a machine wipe as well.
  • Smug Unix User (unregistered) in reply to A Guy

    TRWTF is allowing assignment in a condition.

  • (cs) in reply to faoileag
    faoileag:
    Actually, aren't you braking their EULA by posting it on TDWTF's website?
    I didn't know the EULA was equipped with brakes in the first place. What's the mean airspeed of an unladen EULA?
  • Peter Wolff (unregistered) in reply to Smug Unix User
    Smug Unix User:
    TRWTF is allowing assignment in a condition.
    Smug Unix User, I simply don't understand you, or have times changed that much?

    Allowing arbitrary code in a condition can save more than two keystrokes each time, and when I learned programming and handling computers, Unix users were known for their laziness in typing. (They even use "umount" instead of "unmount", just to save 1 keystroke. Of course this isn't a WTF, is it?)

  • ExceptionHandler (unregistered)

    Doesn't this violate the same origin policy unless all of those addresses resolve to the same server?

  • (cs) in reply to dkf
    dkf:
    faoileag:
    Actually, aren't you braking their EULA by posting it on TDWTF's website?
    I didn't know the EULA was equipped with brakes in the first place. What's the mean airspeed of an unladen EULA?
    An African or a European EULA?
  • Kevin (unregistered) in reply to Mark Bowytz
    Mark Bowytz:
    Oh, one more thing - the download page encourages you with *pulsing pink text* to read the EULA before installing. A sentiment I happen to agree with in all cases, pulsing text or not.

    I didn't see it posted on their site, so I copied the EULA from the installer and posted it here for your reading pleasure: https://thedailywtf.com/images/14/Super_EULA.rtf

    Now, I don't encourage you to do as I did and download the installer just to read the EULA, but do suggest that you check out the section marked "Privacy" to see why.

    EULA:
    This license will automatically be void the moment you use the Software for any purpose other than what is authorized by the terms herein.

    So if you violate the agreement you no longer have to worry about the agreement. With the terms spelled out like that if you were to strip out all the adware and sell the product yourself then the agreement is void and they can't do anything about it.

  • faoileag (unregistered) in reply to dkf
    dkf:
    faoileag:
    Actually, aren't you braking their EULA by posting it on TDWTF's website?
    I didn't know the EULA was equipped with brakes in the first place. What's the mean airspeed of an unladen EULA?
    The missing "e" must have been posted to a different forum by my homegrown keystroke balancer...
  • Anon Coward (unregistered) in reply to Mark Bowytz

    Summary: We only wrote the GUI, all the rest is 3rd party stuff, and it will install other applications, change your browser settings & homepage, and we'll even accept their license agreements cause we're just that helpful. You'll love it! We promise, and if you don't like it, you can sue them, not us, cause we declared it in this agreement.

  • DumbByAssociation (unregistered)

    Let's not lose sight of the fact that this doesn't actually load balance, and simply throws all the incoming traffic to a specific server for any given second...

  • JW (unregistered)

    The real WTF is in this sentence: "...what I consider a rather unique approach..."

    "Unique" is an absolute. Being "rather unique" is like a boolean being "rather false".

  • faoileag (unregistered) in reply to JW
    JW:
    The real WTF is in this sentence: "...what I consider a rather unique approach..."

    "Unique" is an absolute. Being "rather unique" is like a boolean being "rather false".

    What's wrong with "rather false"?

    According to "Advanced Techniques in Knowledge Discovery and Data Mining" by Nikhil Pal (p. 187), "rather false" is one of seven states of truth, starting with "very true" and ending with "very false".

    Say a young person named Bob looks rather tired in the morning, prompting his mother to ask: "Have you been up all night playing WOW???". He answers "No!".

    This answer would be "very false", if that was what indeed he did, but "false" if instead of WOW he had played Quake and only "rather false" if he not only had played Quake but also had dozed off for half an hour or so while camping somewhere.

  • Big Gay EULA (unregistered)

    It's Super, thanks for downloading, All things considered it couldn't be better, I must say, It's Super, it's got no bugs in, Everything is Super when you're DON'T YOU WANT TO INSTALL ALL THIS SHIT!?

  • Greg (unregistered) in reply to JW
    JW:
    The real WTF is in this sentence: "...what I consider a rather unique approach..."

    "Unique" is an absolute. Being "rather unique" is like a boolean being "rather false".

    As in FILE_NOT_FOUND you mean? It doesn't evaluate to true, but neither is it really false. Rather false would word it nicely :-)

  • Leo (unregistered) in reply to faoileag
    According to "Advanced Techniques in Knowledge Discovery and Data Mining" by Nikhil Pal (p. 187), "rather false" is one of seven states of truth, starting with "very true" and ending with "very false".

    Which one is "file not found"?

  • emaN ruoY (unregistered)

    Oh, come on people. We know the best way to solve this is with a math formula

    if (rslt1%3== 0) {domain1 = 'http://www.erightsoft.info';} else
    if (rslt1%3== 1) {domain1 = 'http://www.erightsoft.biz';} else
    if (rslt1%3== 2) {domain1 = 'http://www.erightsoft.org';}

    Granted, we lose the "randomness" achieved by alternating the order of the servers between the three line sections. But, really, that's just "overkill." If we want random, I suppose this may work:

    rslt1=Math.ceil(Math.random()*rslt1);
    if (rslt1%3== 0) {domain1 = 'http://www.erightsoft.info';} else
    if (rslt1%3== 1) {domain1 = 'http://www.erightsoft.biz';} else
    if (rslt1%3== 2) {domain1 = 'http://www.erightsoft.org';}
  • emaN ruoY (unregistered)

    Of course, all this presumes that there is a different server hosting the website on each domain (not necessarily a given).

  • faoileag (unregistered) in reply to Leo
    Leo:
    According to "Advanced Techniques in Knowledge Discovery and Data Mining" by Nikhil Pal (p. 187), "rather false" is one of seven states of truth, starting with "very true" and ending with "very false".

    Which one is "file not found"?

    "unknown"?

  • faoileag (unregistered) in reply to emaN ruoY
    emaN ruoY:
    Of course, all this presumes that there is a different server hosting the website on each domain (not necessarily a given).
    Kabi:
    I was rather disappointed that these URLs really point to different IP addresses. Based on this code, I expected that the requests for these adresses are all handled by the same server again...
  • (cs) in reply to Kabi
    Kabi:
    I was rather disappointed that these URLs really point to different IP addresses. Based on this code, I expected that the requests for these adresses are all handled by the same server again...
    There's no need to be disappointed just because the URLs point to different IP addresses. It's entirely possible for different IPs to end up at the same server. Right now, my employer has one server that handles requests directed at three different IPs. SO, there's still a chance that all of those URLs ARE still handled by the same server ...
  • Kevin (unregistered) in reply to emaN ruoY
    emaN ruoY:
    Of course, all this presumes that there is a different server hosting the website on each domain (not necessarily a given).

    Hey, you don't want to wear out the url from overuse. Probably the reason they changed one of the 4 to the .com. It was used too many times and had to be thrown away.

    Captcha: nobis... My auto complete tells me this isn't the first time I've had this same captcha.

  • (cs) in reply to JW
    JW:
    The real WTF is in this sentence: "...what I consider a rather unique approach..."

    "Unique" is an absolute. Being "rather unique" is like a boolean being "rather false".

    Another pedant that doesn't bother to look up a word in the dictionary:

    unique |yo͞oˈnēk| adjective being the only one of its kind; unlike anything else: the situation was unique in modern politics | original and unique designs.

    • particularly remarkable, special, or unusual: a unique opportunity to see the spectacular Bolshoi Ballet.
    • [ predic. ] (unique to) belonging or connected to (one particular person, group, or place): a style of architecture that is unique to Portugal.
  • willaien (unregistered)

    Does Javascript not have a modulus operator? I mean, load balancing using the local time isn't perfect, but it's something at least. They're trying.

    The bigger WTF is using that many lines to do something that could have been done in much less.

  • Scourge of programmers. (unregistered) in reply to ubersoldat
    ubersoldat:
    Maybe with all the money they spend paying for all those domains they could buy a loadbalancer?

    Also, there are a bunch of OSS load balancers out there, so a it's not that expensive either.

    Anyway, it's funny and truly a WTF since those are the words that will come out if you find this for the first time.

    Spoken like a true sockpuppet. Buying domains is cheaper than buying a load balancer.

  • Chubber (unregistered)

    All this and nobody has picked on the use of a whole-page IFRAME?

    Captch: dolor (Spanish for "pain")

  • Chelloveck (unregistered)

    I was about to make the observation that the code fails during a leap second, but a bit of Googling shows that the JS Date() object disavows all knowledge of leap seconds. You win this time, eRightSoft! Still, that control structure should end with an unconditional else{} block. You know, just in case we ever redefine the number of seconds in a minute or something.

  • Red Five (unregistered) in reply to Mark Bowytz

    If they were just doing a time-based round-robin rotation, they didn't need to specify the server for each second. Just stick the servers into a numerically-indexed array in the desired order. Then do something like

    request_server = servers_array[seconds modulus count(servers_array)];

    Save about 60 lines of code that way, and it's exceedingly simple to add or remove servers and not have to change anything else.

Leave a comment on “Split Second Load Balancing”

Log In or post as a guest

Replying to comment #:

« Return to Article