diff --git a/docs/building.html b/docs/building.html index 052a5e320..7bd47e761 100644 --- a/docs/building.html +++ b/docs/building.html @@ -38,7 +38,7 @@
True physical disk offset queries are only supported on newer linux kernels and Mac OS X.
+True physical disk offset queries are only supported on newer linux kernels, Mac OS X and +Windows 2000 and up.
void load_state(lazy_entry const& e); -void save_state(entry& e) const; +void save_state(entry& e, boost::uint32_t flags) const;
loads and saves all session settings, including dht_settings, encryption settings and proxy @@ -570,6 +580,24 @@ settings. save_state either not be initialized, or initialized as a dictionary.
load_state expects a lazy_entry which can be built from a bencoded buffer with lazy_bdecode.
+The flags arguments passed in to save_state can be used to filter which parts +of the session state to save. By default, all state is saved (except for the individual +torrents). These are the possible flags. A flag that's set, means those settings are saved:
++enum save_state_flags_t +{ + save_settings = 0x001, + save_dht_settings = 0x002, + save_dht_proxy = 0x004, + save_dht_state = 0x008, + save_i2p_proxy = 0x010, + save_encryption_settings = 0x020, + save_peer_proxy = 0x040, + save_web_proxy = 0x080, + save_tracker_proxy = 0x100, + save_as_map = 0x200, +}; +
The wchar_t overloads are for wide character paths.
---void load_state(entry const& ses_state); -entry state() const; --
These functions loads and save session state. Currently, the only state -that's stored is peak download rates for ASes. This map is used to -determine which order to connect to peers.
-@@ -1043,6 +1059,9 @@ struct cache_status int cache_size; int read_cache_size; int total_used_buffers; + int average_queue_time; + int average_read_time; + int job_queue_length; };@@ -1064,6 +1083,12 @@ This includes both read and write cache.
total_used_buffers is the total number of buffers currently in use. This includes the read/write disk cache as well as send and receive buffers used in peer connections.
+average_queue_time is the number of microseconds an average disk I/O job +has to wait in the job queue before it get processed.
+average_read_time is the number of microseconds a read job takes to +wait in the queue and complete, in microseconds. This only includes +cache misses.
+job_queue_length is the number of jobs in the job queue.
-torrent_status status() const; +torrent_status status(boost::uint32_t flags = 0xffffffff) const;
status() will return a structure with information about the status of this torrent. If the torrent_handle is invalid, it will throw libtorrent_exception exception. -See torrent_status.
+See torrent_status. The flags argument filters what information is returned +in the torrent_status. Some information in there is relatively expensive to calculate, and +if you're not interested in it (and see performance issues), you can filter them out. +By default everything is included. The flags you can use to decide what to include are:
+calculates distributed_copies, distributed_full_copies and distributed_fraction.
+includes partial downloaded blocks in total_done and total_wanted_done.
+includes last_seen_complete.
+progress is a value in the range [0, 1], that represents the progress of the @@ -3123,7 +3182,8 @@ allocated. -
When downloading, the progress is total_wanted_done / total_wanted.
+When downloading, the progress is total_wanted_done / total_wanted. This takes +into account files whose priority have been set to 0. They are not considered.
paused is set to true if the torrent is paused and false otherwise.
error may be set to an error message describing why the torrent was paused, in case it was paused by an error. If the torrent is not paused or if it's paused but @@ -3189,9 +3249,9 @@ this does not necessarily has to be downloaded during this session (that's total_payload_download).
total_wanted_done is the number of bytes we have downloaded, only counting the pieces that we actually want to download. i.e. excluding any pieces that we have but -are filtered as not wanted.
+have priority 0 (i.e. not wanted).total_wanted is the total number of bytes we want to download. This is also -excluding pieces that have been filtered.
+excluding pieces whose priorities have been set to 0.num_seeds is the number of peers that are seeding that this client is currently connected to.
distributed_full_copies is the number of distributed copies of the torrent. @@ -3260,6 +3320,12 @@ hope that the disk condition (be it disk full or permission errors) has been resolved. If the torrent is not auto-managed, you have to explicitly take it out of the upload mode by calling set_upload_mode() on the torrent_handle.
+added_time is the posix-time when this torrent was added. i.e. what +time(NULL) returned at the time.
+completed_time is the posix-time when this torrent was finished. If +the torrent is not yet finished, this is 0.
+last_seen_complete is the time when we, or one of our peers, last +saw a complete copy of this torrent.
user_agent this is the client identification to the tracker. @@ -3921,11 +4000,16 @@ cannot be passed back to add_t should ignore any broadcast response from a device whose address is not the configured router for this machine. i.e. it's a way to not talk to other people's routers by mistake.
-send_buffer_waterbark is the upper limit of the send buffer low-watermark. +
send_buffer_watermark is the upper limit of the send buffer low-watermark. if the send buffer has fewer bytes than this, we'll read another 16kB block onto it. If set too small, upload rate capacity will suffer. If set too high, memory will be wasted. The actual watermark may be lower than this in case the upload rate is low, this is the upper limit.
+send_buffer_watermark_factor is multiplied to the peer's upload rate +to determine the low-watermark for the peer. This is clamped to not +exceed the send_buffer_watermark upper limit. This defaults to 1. +For high capacity connections, setting this higher can improve upload +performance and disk throughput.
auto_upload_slots defaults to true. When true, if there is a global upload limit set and the current upload rate is less than 90% of that, another upload slot is opened. If the upload rate has been saturated for an extended period @@ -3964,10 +4048,12 @@ where they are only allowed to download whole pieces. If the whole piece a peer in parole mode fails the hash check, it is banned. If a peer participates in a piece that passes the hash check, it is taken out of parole mode.
cache_size is the disk write and read cache. It is specified in units of -16 KiB blocks. It defaults to 1024 (= 16 MB). Buffers that are part of a peer's -send or receive buffer also count against this limit. Send and receive buffers -will never be denied to be allocated, but they will cause the actual cached blocks -to be flushed or evicted.
+16 KiB blocks. Buffers that are part of a peer's send or receive buffer also +count against this limit. Send and receive buffers will never be denied to be +allocated, but they will cause the actual cached blocks to be flushed or evicted. +If this is set to -1, the cache size is automatically set to the amount +of physical RAM available in the machine divided by 8. If the amount of physical +RAM cannot be determined, it's set to 1024 (= 16 MiB).Disk buffers are allocated using a pool allocator, the number of blocks that are allocated at a time when the pool needs to grow can be specified in cache_buffer_chunk_size. This defaults to 16 blocks. Lower numbers @@ -3989,14 +4075,40 @@ read cache means scanning all pieces and picking a random set of the rarest ones There is an affinity to pick pieces that are already in the cache, so that subsequent refreshes only swaps in pieces that are rarer than whatever is in the cache at the time.
-disk_io_no_buffer defaults to true. When set to true, files are preferred -to be opened in unbuffered mode. This helps the operating system from growing -its file cache indefinitely. Currently only files whose offset in the torrent -is page aligned are opened in unbuffered mode. A page is typically 4096 bytes -and since blocks in bittorrent are 16kB, any file that is aligned to a block -or piece will get the benefit of be opened in unbuffered mode. It is therefore -recommended to make the largest file in a torrent the first file (with offset 0) -or use pad files to align all files to piece boundries.
+disk_io_write_mode and disk_io_read_mode determines how files are +opened when they're in read only mode versus read and write mode. The options +are:
++++
+- +
+
+- enable_os_cache
+- +
This is the default and files are opened normally, with the OS caching +reads and writes.
+- +
+
+- disable_os_cache_for_aligned_files
+- +
This will open files in unbuffered mode for files where every read and +write would be sector aligned. Using aligned disk offsets is a requirement +on some operating systems.
+- +
+
+- disable_os_cache
+- +
This opens all files in unbuffered mode (if allowed by the operating system). +Linux and Windows, for instance, require disk offsets to be sector aligned, +and in those cases, this option is the same as disable_os_caches_for_aligned_files.
+
One reason to disable caching is that it may help the operating system from growing +its file cache indefinitely. Since some OSes only allow aligned files to be opened +in unbuffered mode, It is recommended to make the largest file in a torrent the first +file (with offset 0) or use pad files to align all files to piece boundries.
outgoing_ports, if set to something other than (0, 0) is a range of ports used to bind outgoing sockets to. This may be useful for users whose router allows them to assign QoS classes to traffic based on its local port. It is @@ -4134,7 +4246,7 @@ data is read from the disk while checking. This may be useful for background tasks that doesn't matter if they take a bit longer, as long as they leave disk I/O time for other processes.
disk_cache_algorithm tells the disk I/O thread which cache flush -algorithm to use. The default (and original) algorithm is LRU. This +algorithm to use. The default algorithm is largest_contiguous. This flushes the entire piece, in the write cache, that was least recently written to. This is specified by the session_settings::lru enum value. session_settings::largest_contiguous will flush the largest @@ -4247,6 +4359,12 @@ sometimes, but it may also avoid downloading a lot of redundant bytes. If this is false, libtorrent attempts to use each peer connection to its max, by always requesting something, even if it means requesting something that has been requested from another peer already.
+default_peer_upload_rate and default_peer_download_rate specifies +the default upload and download rate limits for peers, respectively. These +default to 0, which means unlimited. These settings affect the rate limits +set on new peer connections (not existing ones). The peer rate limits can +be changed individually later using +set_peer_upload_limit() set_peer_download_limit().
tracker errors:
+170 | +scrape_not_available | +The tracker URL doesn't support transforming it into a scrape +URL. i.e. it doesn't contain "announce. | +
171 | +invalid_tracker_response | +invalid tracker response | +
172 | +invalid_peer_dict | +invalid peer dictionary entry. Not a dictionary | +
173 | +tracker_failure | +tracker sent a failure message | +
174 | +invalid_files_entry | +missing or invalid 'files' entry | +
175 | +invalid_hash_entry | +missing or invalid 'hash' entry | +
176 | +invalid_peers_entry | +missing or invalid 'peers' and 'peers6' entry | +
177 | +invalid_tracker_response_length | +udp tracker response packet has invalid size | +
178 | +invalid_tracker_transaction_id | +invalid transaction id in udp tracker response | +
179 | +invalid_tracker_action | +invalid action field in udp tracker response | +
The names of these error codes are declared in then libtorrent::errors namespace.
There is also another error category, libtorrent::upnp_category, defining errors retrned by UPnP routers. Here's a (possibly incomplete) list of UPnP error codes:
@@ -7053,7 +7222,7 @@ to where they belong. This is the recommended (and default) mode.The allocation mode is selected when a torrent is started. It is passed as an argument to session::add_torrent() (see add_torrent()).
The decision to use full allocation or compact allocation typically depends on whether -any files are filtered and if the filesystem supports sparse files.
+any files have priority 0 and if the filesystem supports sparse files.On filesystems that supports sparse files, this allocation mode will only use @@ -7094,7 +7263,7 @@ filesystems' file allocation, and reduce fragmentation. sparse files are being used.
The benefits though, are:
diff --git a/docs/tuning.html b/docs/tuning.html index 88d5e5c3e..e8cbe8770 100644 --- a/docs/tuning.html +++ b/docs/tuning.html @@ -38,7 +38,7 @@