Re: [asio-users] performance problems on Linux in a multithreaded environment
Brought to you by:
chris_kohlhoff
From: namreeb <as...@na...> - 2015-08-29 18:53:31
|
Hello Marat, Thank you for your reply. I apologize that I am not an expert on ASIO. If I understand you correctly, using one service per thread rather than a global service will solve (or possibly work around) the problem. When you say that a Linux VM with this solution shows improved results in terms of CPU, does it also improve overall throughput? If having access to a physical Linux server would somehow assist, I can arrange to help you test if you'd like. Thank you! On Sat, Aug 29, 2015 at 8:38 AM, Marat Abrarov <ab...@ma...> wrote: > Hi namreeb, > > > some internal mutex which essentially prevents epoll() from executing > across multiple threads simultaneously. > > I believe, io_service-per-thread (number of threads ~ number of CPUs) > should solve this. I use this way in asio_samples project ( > https://github.com/mabrarov/asio_samples) - the echo_server application > can be configured to use: > > 1. single instance of boost::asio::io_service for all work (IO) threads - > default configuration on Windows as Windows IOCP schedules threads better > this way. > 2. io_service-per-thread (number of threads == number of CPUs) - default > configuration on non-Windows OS. > > Unfortunately, I have no hardware machine (only virtual machine) to test > performance on Linux (the second option). On Linux VM the second option > shows better and more stable CPU loading then the first one. > > Regards, > Marat Abrarov. > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > asio-users mailing list > asi...@li... > https://lists.sourceforge.net/lists/listinfo/asio-users > _______________________________________________ > Using Asio? List your project at > http://think-async.com/Asio/WhoIsUsingAsio > |