Thread: Choosing the Best Networking Solution for a Server Project

Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 85
  1. #21  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,578
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by iKilem View Post
    Nah, because what you said to Maxi is valid and should be a concern. You could probably help it by having more "states", but there's really no point if your code gets too complicated, and you'll lose the advantage of ReplayingDecoder anyway. Perhaps use ReplayingDecoder for debugging purposes and then FrameDecoder for the real deal.
    In that case, why even bother with writing a ReplayingDecoder implementation for debugging/testing? Like I said, the extra logic needed for a FrameDecoder isn't really that hard...
    .
    Reply With Quote  
     

  2. #22  
    Jim
    Jim is offline
    I dunno, its fine I guess

    Join Date
    Feb 2007
    Posts
    147
    Thanks given
    12
    Thanks received
    33
    Rep Power
    265
    Quote Originally Posted by Graham View Post
    In that case, why even bother with writing a ReplayingDecoder implementation for debugging/testing? Like I said, the extra logic needed for a FrameDecoder isn't really that hard...
    I guess it's a tradeoff between cleaner code and performance. But until I see actual numbers, I'm going to call this premature optimisation.

    I really doubt that in a server with 2000 players the packet decoding would be the bottleneck.
    Reply With Quote  
     

  3. #23  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    21
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    this is why i avoid Java, so many design abstractions
    [Only registered and activated users can see links. ]

    If you are a starter and want to learn rsps coding, i think that the server that fits most of your requests is deathlypvpz.
    I know some stone heads will flame and say its shit, i completely agree buy deathlypvpz is the best thing to start with.
    And you must do some Java courses in codecademy to improve yourself.
    Reply With Quote  
     

  4. #24  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    obviously NIO, not much of a discussion.

    blocking IO is faster than NIO by a bit, but it blocks...

    you can block with NIO, which will give you better performance than IO, but you need a thread per client model

    for best performance, just use NIO (no API), either blocking or non-blocking.
    Reply With Quote  
     

  5. #25  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    something you continued to miss until i pointed it out... which you can't really be doing while programming

    EDIT: not here to argue... to answer your statement, no my implementation is not bad, i used the reactor pattern and also i would like to see someone try the blocking thread per client model with nio, haven't tried it myself
    Reply With Quote  
     

  6. #26  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,549
    Thanks given
    192
    Thanks received
    761
    Discord
    View profile
    Rep Power
    1332
    Quote Originally Posted by filth View Post
    i would like to see someone try the blocking thread per client model with nio, haven't tried it myself
    I wouldn't. Its counterproductive, and ultimately handicapping your server due to the overhead of the exorbitant number of threads needed. Speed is always good but scalability and practicality are more important in my opinion. To tell the truth, its unpractical to have a host with the physical capabilities of holding a large amount of connections using that design.

    As a result, I don't think that anyone should waste their time following that model.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  7. #27  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    it's not handicapping your server..

    i think you overestimate the overhead, and of course, speed is way more important then overhead in the case of an MMORPG (if it's practical, and in this case it is practical, 2000 threads? pfft, java can handle thousands more than that).

    the trade off is simply: speed at the cost of more processing power, and there's nothing wrong with that
    Reply With Quote  
     

  8. #28  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,549
    Thanks given
    192
    Thanks received
    761
    Discord
    View profile
    Rep Power
    1332
    Quote Originally Posted by filth View Post
    it's not handicapping your server..

    i think you overestimate the overhead, and of course, speed is way more important then overhead in the case of an MMORPG (if it's practical, and in this case it is practical, 2000 threads? pfft, java can handle thousands more than that).

    the trade off is simply: speed at the cost of more processing power, and there's nothing wrong with that
    I don't know if I speak for myself only, but the average thread on windows takes roughly 2mb ram.
    2 mb ram with 2000 connections is roughly 4 gigabytes ram. The ironic part is that the memory is dedicated to those specific connections only and can't be reused or utilized by the rest of your program.
    As a result, I still think that it is inefficient, because my pockets are not lined with gold.

    Also, man, I know your smart as hell, you don't have to prove that to me by posting stuff to prove the errors of my ways by saying that threads take less memory on linux.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  9. #29  
    Banned

    Join Date
    Mar 2008
    Posts
    2,595
    Thanks given
    128
    Thanks received
    191
    Rep Power
    0
    that's a gross overstatement, i think you should double check how much memory a thread really takes, you can both specify stack size (default size 512kb??? i think not sure) and then rest of memory thread uses is shared memory between threads (-Xss and -Xmx on command line to specify thread stack size and max memory used).

    i don't know if your computer has a defect or something, but you should be able to have 2000 threads A-ok.

    at 2013 threads, program is using 116,340KB of memory (that's with all the threads waiting. with the threads looping at 600ms, the memory goes down to ~105,000KB) which is not alot, considering my laptop has 4GB and yeah, you don't want to hear this but, jagex doesn't host their servers on windows and neither should you (but it will suffice for an RSPS)
    Reply With Quote  
     

  10. #30  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,664
    Thanks given
    493
    Thanks received
    627
    Rep Power
    980
    Quote Originally Posted by filth
    you can block with NIO, which will give you better performance than IO, but you need a thread per client model
    You sure about that?

    Quote Originally Posted by filth
    i think you overestimate the overhead, and of course, speed is way more important then overhead in the case of an MMORPG (if it's practical, and in this case it is practical, 2000 threads? pfft, java can handle thousands more than that).

    the trade off is simply: speed at the cost of more processing power, and there's nothing wrong with that
    By overhead, are you talking about memory overhead? (Surely you're not talking about speed overhead, because that wouldn't make any sense in your statement.) I'd say that keeping memory contention low is the priority, but that depends on the situation. Perhaps you're fine with with hosting on a 4GB dedi, but I'm sure many people would like to keep their costs low. By design, thread-per-client does not only introduce memory overhead, but speed overhead as well. Using "blocking NIO" is not going to be better. Why would it be? It's still blocking in the end.

    What do you mean by "speed at the cost of more processing power"?
    ~iKilem
    Reply With Quote  
     

Page 3 of 9 FirstFirst 12345 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Client/Server Networking
    By Vegito in forum Help
    Replies: 3
    Last Post: 12-19-2010, 02:22 PM
  2. Replies: 0
    Last Post: 11-16-2010, 02:08 PM
  3. Need help choosing VPS !
    By Henkkaah in forum Hosting
    Replies: 6
    Last Post: 08-07-2010, 05:32 AM
  4. Replies: 15
    Last Post: 04-27-2010, 07:35 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •