PDA

View Full Version : QtNetwork Performance



ngenen
24th November 2010, 16:13
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!

tbscope
25th November 2010, 05:42
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

Timoteo
25th November 2010, 06:46
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.

ngenen
25th November 2010, 07:10
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:


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!!

wysota
25th November 2010, 12:31
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.

ngenen
25th November 2010, 19:08
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!