Results 1 to 6 of 6

Thread: QtNetwork Performance

  1. #1
    Join Date
    Nov 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question QtNetwork Performance

    Hello there!
    I'm new here and I'm wondering if anyone have experience with measuring qtnetwork performance. Let's say I'm writing a indie game server from scratch and I'll need support more than 5k simultaneous connections.

    My questions are,
    Would qtnetwork fit my needs or I should go for another library like boost::asio ?
    Which design I should follow ? (Would be good code example)
    Does anyone know how QtNetwork works for connection handling ? Is like boost::asio which uses the best model of each OS ?


    Thanks in Advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QtNetwork Performance

    Quote Originally Posted by ngenen View Post
    Would qtnetwork fit my needs or I should go for another library like boost::asio ?
    As with 5000 connections, it's not what Qt or Boost can do. At this point you also and most certainly need to look at your operating system and hardware. Although I guess most modern systems can handle that much connections without too much problems.

    Anyway, make a couple of tests and benchmarks. See which library gives you the best results and use that one.

    Which design I should follow ? (Would be good code example)
    Never, ever, use threads for that amount of connections, ever! You will DoS yourself!

    Does anyone know how QtNetwork works for connection handling ? Is like boost::asio which uses the best model of each OS ?
    http://doc.qt.nokia.com/4.7/network-programming.html

  3. #3
    Join Date
    Sep 2010
    Posts
    145
    Thanks
    1
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtNetwork Performance

    Quote Originally Posted by ngenen View Post
    Which design I should follow ? (Would be good code example)
    This is totally beyond the scope of a single forum topic.

    Here are some questions you need answered before you can proceed:

    Which synchronization method will I employ to achieve shared game state? With which protocol?
    Have I identified my server hardware architecture? What about operating system? Can I compete while using a cross-platform framework on this platform?
    How do I handle growth? Is my design adaptable for clustering? What about load balancing?

    What exactly do I need?

    See why we can't really give you a meaningful answer to "will it fit my needs"? That's something only you can answer through research, modeling, and trial.

  4. #4
    Join Date
    Nov 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QtNetwork Performance

    I understand that, and I already readed the documentation, but my questions were in a deeper sense, like the internal design, so for example, in windows, the IOCP design uses one thread to accept incoming connections and n Worker Threads to read/write to clients and support 10k easily, so, my question in a simple way was, which method QtNetwork uses for the QTcpServer design ? select ? epoll ? kpoll ? IOCP ? that is what I meant to say with "OS dependent server design".

    Thank you!!!


    Added after 14 minutes:


    Quote Originally Posted by Timoteo View Post
    This is totally beyond the scope of a single forum topic.

    Here are some questions you need answered before you can proceed:

    Which synchronization method will I employ to achieve shared game state? With which protocol?
    Have I identified my server hardware architecture? What about operating system? Can I compete while using a cross-platform framework on this platform?
    How do I handle growth? Is my design adaptable for clustering? What about load balancing?

    What exactly do I need?

    See why we can't really give you a meaningful answer to "will it fit my needs"? That's something only you can answer through research, modeling, and trial.
    My question it's more about internal design, I have some knowledge about what you're saying, but I just wanted to know if anyone know how QTcpServer works internally, as far I see, it's event driven, so it could fit my needs, if the design is good. Thank you for your help!!
    Last edited by ngenen; 25th November 2010 at 07:10.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtNetwork Performance

    Quote Originally Posted by ngenen View Post
    so, my question in a simple way was, which method QtNetwork uses for the QTcpServer design ? select ? epoll ? kpoll ? IOCP ?
    1. It depends on the platform.
    2. Qt is open-source, take the sources and check it out yourself.
    3. Qt is open-source, you can adapt it to your needs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Nov 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QtNetwork Performance

    Quote Originally Posted by wysota View Post
    1. It depends on the platform.
    2. Qt is open-source, take the sources and check it out yourself.
    3. Qt is open-source, you can adapt it to your needs.
    I did so, and I found that everything is based on select model supported by the event loop

    Thank you!

Similar Threads

  1. qmake and QtNetwork
    By gt.beta2 in forum Newbie
    Replies: 6
    Last Post: 15th March 2009, 00:46
  2. No error from QTNetwork if network goes off
    By Ganesh in forum Qt Programming
    Replies: 6
    Last Post: 27th November 2008, 22:29
  3. QtNetwork
    By wagui in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2008, 22:54
  4. QtNetwork send ICMP Packet
    By SlowTree in forum Qt Programming
    Replies: 3
    Last Post: 29th October 2007, 21:13
  5. how to transmission a big file use the QtNetwork
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 26th March 2007, 15:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.