diff --git a/include/libtorrent/session_settings.hpp b/include/libtorrent/session_settings.hpp index 9a6b3eb3a..5d093ea71 100644 --- a/include/libtorrent/session_settings.hpp +++ b/include/libtorrent/session_settings.hpp @@ -177,7 +177,7 @@ namespace libtorrent , optimize_hashing_for_speed(true) , file_checks_delay_per_block(0) , disk_cache_algorithm(largest_contiguous) - , read_cache_line_size(16) + , read_cache_line_size(128) , write_cache_line_size(32) , optimistic_disk_retry(10 * 60) , disable_hash_checks(false) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 9fa4c7d3a..df48dc9dc 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -3858,6 +3858,7 @@ namespace libtorrent int num_uploads = m_ses.num_uploads(); if (num_uploads == 0) num_uploads = 1; + // assume half of the cache is write cache if we're downloading // this torrent as well int cache_size = m_ses.m_settings.cache_size / num_uploads; @@ -3866,9 +3867,6 @@ namespace libtorrent // cache line should not be greater than this // try to avoid locking caches for more than a couple of seconds - if (upload_rate * 4 / 16 / 1024 < cache_size) - cache_size = upload_rate * 4 / 16 / 1024; - expiry = cache_size * 16 * 1024 / upload_rate; if (expiry < 1) expiry = 1; else if (expiry > 10) expiry = 10;