qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
27.11k stars 3.9k forks source link

100% CPU consumption on a lousy internet connection #15546

Open l29ah opened 2 years ago

l29ah commented 2 years ago

qBittorrent & operating system versions

qBittorrent: 4.3.8 x64 Operating system: Gentoo Lignux Qt: 5.15.2 libtorrent-rasterbar: 2.0.4

What is the problem?

CPU stays at 100%. Top of perf says:

    46.73%     0.00%  qbittorrent      [unknown]                      [k] 0x8948535538678d4c
            |
            ---0x8948535538678d4c
               boost::asio::detail::scheduler::~scheduler
               0x7f47d9b87990
               |          
               |--27.67%--boost::asio::detail::wait_handler<std::_Bind<void (*(std::weak_ptr<libtorrent::http_connection>, std::_Placeholder<1>))(std::weak_ptr<libtorrent::http_connection>, boost::system::error_code const&)>, boost::asio::any_io_executor>::do_complete
               |          |          
               |          |--13.20%--libtorrent::http_connection::on_timeout
               |          |          
               |          |--3.66%--__pthread_mutex_unlock_usercnt
               |          |          
               |          |--0.70%--std::chrono::_V2::system_clock::now
               |          |          
               |           --0.53%--boost::asio::detail::epoll_reactor::cancel_timer<boost::asio::detail::chrono_time_traits<std::chrono::_V2::system_clock, boost::asio::wait_traits<std::chrono::_V2::system_clock> > >
               |          
               |--5.25%--std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_weak_release
               |          
               |--4.86%--boost::asio::detail::scheduler::do_run_one
               |          
               |--3.67%--__pthread_mutex_lock
               |          
               |--3.33%--__pthread_mutex_unlock_usercnt
               |          
                --0.59%--boost::asio::detail::scheduler::run

    46.73%     0.00%  qbittorrent      libtorrent-rasterbar.so.2.0.4  [.] boost::asio::detail::scheduler::~scheduler
            |
            ---boost::asio::detail::scheduler::~scheduler
               0x7f47d9b87990
               |          
               |--27.67%--boost::asio::detail::wait_handler<std::_Bind<void (*(std::weak_ptr<libtorrent::http_connection>, std::_Placeholder<1>))(std::weak_ptr<libtorrent::http_connection>, boost::system::error_code const&)>, boost::asio::any_io_executor>::do_complete
               |          |          
               |          |--13.20%--libtorrent::http_connection::on_timeout
               |          |          
               |          |--3.66%--__pthread_mutex_unlock_usercnt
               |          |          
               |          |--0.70%--std::chrono::_V2::system_clock::now
               |          |          
               |           --0.53%--boost::asio::detail::epoll_reactor::cancel_timer<boost::asio::detail::chrono_time_traits<std::chrono::_V2::system_clock, boost::asio::wait_traits<std::chrono::_V2::system_clock> > >
               |          
               |--5.25%--std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_weak_release
               |          
               |--4.86%--boost::asio::detail::scheduler::do_run_one
               |          
               |--3.67%--__pthread_mutex_lock
               |          
               |--3.33%--__pthread_mutex_unlock_usercnt
               |          
                --0.59%--boost::asio::detail::scheduler::run

    46.73%     0.00%  qbittorrent      [unknown]                      [.] 0x00007f47d9b87990
            |
            ---0x7f47d9b87990
               |          
               |--27.67%--boost::asio::detail::wait_handler<std::_Bind<void (*(std::weak_ptr<libtorrent::http_connection>, std::_Placeholder<1>))(std::weak_ptr<libtorrent::http_connection>, boost::system::error_code const&)>, boost::asio::any_io_executor>::do_complete
               |          |          
               |          |--13.20%--libtorrent::http_connection::on_timeout
               |          |          
               |          |--3.66%--__pthread_mutex_unlock_usercnt
               |          |          
               |          |--0.70%--std::chrono::_V2::system_clock::now
               |          |          
               |           --0.53%--boost::asio::detail::epoll_reactor::cancel_timer<boost::asio::detail::chrono_time_traits<std::chrono::_V2::system_clock, boost::asio::wait_traits<std::chrono::_V2::system_clock> > >
               |          
               |--5.25%--std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_weak_release
               |          
               |--4.86%--boost::asio::detail::scheduler::do_run_one
               |          
               |--3.67%--__pthread_mutex_lock
               |          
               |--3.33%--__pthread_mutex_unlock_usercnt
               |          
                --0.59%--boost::asio::detail::scheduler::run

Attaching full perf report: perf-report.txt

Steps to reproduce

Be on a shitty wifi hopping connection and it will pop up. It doesn't always happen.

Additional context

No response

Log(s) & preferences file(s)

qBittorrent.conf.txt Nothing happens in the log.

ivan commented 2 years ago

I don't have a working perf at the moment to confirm, but I am probably having the same issue on NixOS with qbittorrent 4.3.8 x64 / libtorrent-rasterbar 2.0.4. I see 100% of a core being used.

I moved my comment to a new issue https://github.com/qbittorrent/qBittorrent/issues/15623 because it might have a different cause.