aboutsummaryrefslogtreecommitdiffhomepage
path: root/FAQ.md
diff options
context:
space:
mode:
authorMark Van den Borre <mark+github@markvdb.be>2020-11-06 15:27:37 +0100
committerGitHub <noreply@github.com>2020-11-06 15:27:37 +0100
commita5c9fa1051c9b658ddc0bf6bd9e7979364316c91 (patch)
tree878f0a9eff46e1214b8638fd42d3e34fcf2f9633 /FAQ.md
parent861a188ca1d2aaa58eba6f281a5c2f2bf3196fcf (diff)
downloadPeerTube-a5c9fa1051c9b658ddc0bf6bd9e7979364316c91.tar.gz
PeerTube-a5c9fa1051c9b658ddc0bf6bd9e7979364316c91.tar.zst
PeerTube-a5c9fa1051c9b658ddc0bf6bd9e7979364316c91.zip
Update FAQ.md wrt performance estimates and strategies (#3246)
Co-authored-by: Rigel Kent <sendmemail@rigelk.eu>
Diffstat (limited to 'FAQ.md')
-rw-r--r--FAQ.md41
1 files changed, 34 insertions, 7 deletions
diff --git a/FAQ.md b/FAQ.md
index 948cb96b0..b84696620 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -106,15 +106,42 @@ Views are buffered, so don't panic if the view counter stays the same after you
106 106
107## Should I have a big server to run PeerTube? 107## Should I have a big server to run PeerTube?
108 108
109Not really. For instance, the demonstration server [https://peertube.cpy.re](https://peertube.cpy.re) has 2 vCores and 2GB of RAM and consumes on average: 109PeerTube should run happily on a virtual machine with 2 threads/vCPUs, at least 1 Gb of RAM and enough storage for videos. In terms of bandwidth, a lot will depend on which PeerTube instances you federate with and what your relation with them is (more about that below).
110 * **CPU** -> nginx ~ 20%, peertube ~ 10%, postgres ~ 1%, redis ~ 3%
111 * **RAM** -> nginx ~ 6MB, peertube ~ 120MB, postgres ~ 10MB, redis ~ 5MB
112 110
113So you would need: 111As a real life example, the PeerTube demonstration server [https://peertube.cpy.re](https://peertube.cpy.re) runs on 2 vCores and 2GB of RAM. Average consumption is:
114 * **CPU** 1 core if you don't enable transcoding, 2 at least if you enable it (works with 1 but this is really slow) 112 * **CPU**: nginx ~ 20%, peertube ~ 10%, postgres ~ 1%, redis ~ 3%
115 * **RAM** 1GB 113 * **RAM**: nginx ~ 6MB, peertube ~ 120MB, postgres ~ 10MB, redis ~ 5MB
116 * **Storage** Completely depends on how many videos your users will upload
117 114
115### CPU
116
117Except for video transcoding, a PeerTube instance is not CPU bound. Neither Nginx, PeerTube itself, PpostgreSQL nor Redis require a lot of computing power. If it were only for those, one could easily get by with just one thread/vCPU.
118
119You will hugely benefit from at least a second thread though, because of transcoding. Transcoding _is_ very cpu intensive. It serves two purposes on a PeerTube instance: it ensures all videos can be played optimally in the web interface, and it generates different resolutions for the same video. PeerTube support for offloading transcoding to other machines is being discussed, but not yet implemented. See https://github.com/Chocobozzz/PeerTube/issues/947 .
120
121### RAM
122
1231 Gb of RAM should be plenty for a basic PeerTube instance, which usually takes at most 150 Mb in RAM. The only reason you might want more would be if you colocate your Redis or PostgreSQL services on a non-SSD system.
124
125### Storage
126
127There are two important angles to storage: disk space usage and sustained read speed.
128
129To make a rough estimate of your disk space usage requirements, you want to know the answer to three questions:
130- What is the total size of the videos you wish to stream?
131- Do you want to enable transcoding? If so, do you want to provide multiple resolutions per video? Try this out with a few videos and you will get an idea of how much extra space is required per video and estimate a multiplication factor for future space allocation.
132- Which sharing mechanisms do you want to enable? Just WebTorrent, or also HLS with p2p? If you want both, this will double your storage needs.
133
134In terms of read speed, you want to make sure that you can saturate your network uplink serving PeerTube videos. This should not be a problem with SSD disks, whereas traditional HDD should be accounted for: typical sustained read rates for [a well tuned system](support/doc/production.md#tcpip-tuning) with a 7200rpm hard disk should hover around 120 MB/s or 960 Mbit/s. The latter should be enough for a typical 1 Gbit/s network uplink.
135
136### Network
137
138A rough estimate of a traditional server's video streaming network capacity is usually quite straightforward. You simply divide your server's available bandwidth by the average bandwidth per stream, and you have an upper bound.
139
140Take a server for example with a 1 Gbit/s uplink for example pushing out 1080p60 streams at 5 Mbit/s per stream. That means the absolute theoretical upper capacity bound is 200 simultaneous viewers if your server's disk i/o can keep up. Expect a bit less in practice.
141
142But what if you need to serve more users? That's where PeerTube's federation feature shines. If other PeerTube instances following yours, chances are they have decided to mirror part of your instance! The feature is called "server redundancy" and caches your most popular videos to help serve additional viewers. While viewers themselves contribute a little additional bandwidth while watching the video in their browsers (mostly during surges), mirroring servers have a much greater uplink and will help your instance with sustained higher concurrent streaming.
143
144If all your preparations and friends' bandwidth is not enough, you might prefer serving files from a CDN ; see our [remote storage guide](https://docs.joinpeertube.org/#/admin-remote-storage).
118 145
119## Can I seed videos with my classic BitTorrent client (Transmission, rTorrent...)? 146## Can I seed videos with my classic BitTorrent client (Transmission, rTorrent...)?
120 147