diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index c5b8ec558..507c026e6 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -308,7 +308,8 @@ namespace libtorrent int piece_counter = 0; int completed_piece = 0; int piece_read_ahead = 16 * 1024 * 1024 / t.piece_length(); - if (piece_read_ahead < 6) piece_read_ahead = 6; + // at least 4 jobs at a time per thread + if (piece_read_ahead < 12) piece_read_ahead = 12; for (int i = 0; i < piece_read_ahead; ++i) { diff --git a/src/torrent.cpp b/src/torrent.cpp index b00a5098c..e5a6d72ef 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2764,9 +2764,9 @@ namespace { int num_outstanding = settings().get_int(settings_pack::checking_mem_usage) * block_size() / m_torrent_file->piece_length(); // if we only keep a single read operation in-flight at a time, we suffer - // significant performance degradation. Always keep at least two jobs + // significant performance degradation. Always keep at least 4 jobs // outstanding per hasher thread - int const min_outstanding = 2 + int const min_outstanding = 4 * std::max(1, settings().get_int(settings_pack::aio_threads) / disk_io_thread::hasher_thread_divisor); if (num_outstanding < min_outstanding) num_outstanding = min_outstanding;