New to servers need a bit of guidance

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

mrlonely

New Member
May 21, 2023
6
0
1
Lets say you have a video hosting web application (Django), and want to host your own videos with a fixed bitrate of 650000 and 720p, and you have like 500 users watching, want kinda serve would i need to buy, im a bit new to servers and stuff like that, im a web developer, if you could point me in the right direction that would be great, thanks, and hi btw :)
 

Rand__

Well-Known Member
Mar 6, 2014
6,634
1,767
113
Hi,

the regular approach would be to run a test scenario with one/a few users to identify cpu/memory/disk io/space requirements and then scale up.
O/c there are some optimizations you can implement (gpus to offload en/decoding etc), so its not totally straight forward...
 
  • Like
Reactions: mrlonely

mrlonely

New Member
May 21, 2023
6
0
1
Hi,

the regular approach would be to run a test scenario with one/a few users to identify cpu/memory/disk io/space requirements and then scale up.
O/c there are some optimizations you can implement (gpus to offload en/decoding etc), so its not totally straight forward...
BUT it is possible? I know how to build PCs but i dont really now how to build a server, I was thinking maybe a Xeon E-2224, 16Gb ram, but i dont know what to use HHDs or SSDs? the videos will average between 100mb - 400mb. I dont want the videos buffering or have trouble loading, i couldn't find anything solid online, and thanks for answering
 

zac1

Well-Known Member
Oct 1, 2022
432
358
63
You might try profiling your use case. A relatively inexpensive way to do this might be hourly server rentals.
 
  • Like
Reactions: mrlonely

Rand__

Well-Known Member
Mar 6, 2014
6,634
1,767
113
Everything is possible, but might not be feasible.

So lets start reverse -

Starting with Disk IO
going by 720p, H.264 encoded, the internet says 3Mbps = 3000kbit= 375kbyte = 0,375MB/s .

0,375x500 = 187,5 MB/s
Thats something even a harddisk could do, but o/c you'd have 500 concurrent processes which will not match the IOPS capabilities of a hard drive.

So we're talking SSD or NVME here. Depending on blocksize (1M for streaming), 500 iops should be well in range of most SSDs.

CPU - this is where things get interesting - Even if all you do would be serving data (ie no encoding at all), you're looking at 500 processes running in parallel (depending on how Django aggregates io access maybe less, but lets assume it doesnt). E-2224 has 4 threads, lets keep one for the OS we have 3 for serving data.
That means with a total of 3x 3.4Ghz =10,2Ghz that leaves 20MHz per client... Even if this is heavily optimized I doubt that CPU would be sufficient.

I'd recommend to see how much load you get for a single user and scale that up, i.e. if a single user takes 3% of a single core then u know you could sustain ~ 33 Users with a single core of that CPU...
Similar with memory...
 
Last edited:

oneplane

Well-Known Member
Jul 23, 2021
845
484
63
Rent something, start benchmarking. Then buy. How expensive it will get has a hard floor/starting point, but how high the cost will rise depends on how you build your application. Running all video data through Django for example, that would be a way to make it much much more expensive.
 
  • Like
Reactions: mrlonely

mrlonely

New Member
May 21, 2023
6
0
1
Rent something, start benchmarking. Then buy. How expensive it will get has a hard floor/starting point, but how high the cost will rise depends on how you build your application. Running all video data through Django for example, that would be a way to make it much much more expensive.
Why running all the video data through Django would be expensive? it requires more processing power?
 

Sean Ho

seanho.com
Nov 19, 2019
774
357
63
Vancouver, BC
seanho.com
Simply serving up static content is low-CPU, primarily disk I/O; any all-flash array would be more than capable. What is producing these videos, and how are they consumed? Are users uploading videos continually? Are the videos ingested from streaming sources? Is it purely VOD, or also live streaming -- and if the latter, what kind of latency expectations are there? Do you control the bitrate and codec of the input? If not, do you have time in between upload and view to do offline transcoding? What's the mapping from videos to viewers look like -- each viewer only watches their own videos, or certain high-use videos have tons of viewers, while others in the long tail have very few? Are your viewers dispersed geographically, or centered in a couple remote offices?
 
  • Like
Reactions: mrlonely

mrlonely

New Member
May 21, 2023
6
0
1
Simply serving up static content is low-CPU, primarily disk I/O; any all-flash array would be more than capable. What is producing these videos, and how are they consumed? Are users uploading videos continually? Are the videos ingested from streaming sources? Is it purely VOD, or also live streaming -- and if the latter, what kind of latency expectations are there? Do you control the bitrate and codec of the input? If not, do you have time in between upload and view to do offline transcoding? What's the mapping from videos to viewers look like -- each viewer only watches their own videos, or certain high-use videos have tons of viewers, while others in the long tail have very few? Are your viewers dispersed geographically, or centered in a couple remote offices?
The web application is kinda like YouTube, as of now videos are encoded on the same PC that is hosting the site, the site is allowing users to upload their own videos, and view other users videos, and viewers are from all around the world, and yes it is offline transcoding if that is what you mean (im sorry if i didn't understand you correctly)
 

Rand__

Well-Known Member
Mar 6, 2014
6,634
1,767
113
You're transcoding on the same box? On the fly? Or during off-peak hours? CPU or GPU?
This might add significant load the the box that the CPUmight need to be capable of handling
 
  • Like
Reactions: mrlonely

mrlonely

New Member
May 21, 2023
6
0
1
You're transcoding on the same box? On the fly? Or during off-peak hours? CPU or GPU?
This might add significant load the the box that the CPUmight need to be capable of handling
Im not that worried about that, i dont expect users to upload videos 24/24, if that becomes a issue i can just add another PC to run the RQ worker there, i just want the videos to run well for all users across the globe, what CPU would you recommend? and i was thinking SSDs like you said, any recommendations on that? thanks :)
 

Rand__

Well-Known Member
Mar 6, 2014
6,634
1,767
113
You really should gauge load before buying anything more expensive than a pi...
SSD recommendations totally depend on total size, nr of drives, storage type, location, budget etc