PCDN (P2P CDN) Peer-to-Peer Content Delivery Network, you can probably guess what it does from the name. Conventional CDN services are mainly provided by large companies, using CDN servers distributed across the country to provide access to static resources. Alibaba Cloud provides PCDN services, if you're interested, you can take a look at Alibaba Cloud PCDN.
Imagine this scenario: Your neighbor is watching Tencent Video at home. Generally, this video is stored on Tencent's servers. If many people are watching this video at the same time, Tencent's servers will be under a lot of pressure (mainly disk read pressure and bandwidth pressure).
Moreover, if this server is far from your home, besides server pressure, isn't bandwidth transmission also a waste? At this time, if your computer at home acts as a CDN node and pre-caches this video on your computer, when someone nearby accesses this resource, it will be accessed from your computer first, so you don't have to waste the vendor's server resources.
But why do we do this? It must be because someone pays me, I'm willing to be a CDN node. I use Wangxin Cloud (purely for hobbies, just playing around), let me explain how to deploy it:
Prerequisites#
First, you need to have a server (also known as a computer, an idle cloud server will also work) and a basic understanding of Docker;
Personal opinion: This is just for fun, don't expect to make much money from it. Using your own computer as a CDN node requires keeping it on 24/7, which consumes electricity, hard disk space, and network resources;
Disclaimer#
This article is not a tutorial on how to make money. The original intention of writing this article is to share interesting tools, software, ideas, etc. Welcome to discuss with like-minded friends who love to tinker.
Installing Docker#
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Pulling Docker image and starting#
docker run -d --name=wxedge \
--restart=always --privileged --net=host \
--tmpfs /run --tmpfs /tmp \
-v /data/wxedge_storage:/storage:rw \
onething1/wxedge
Note: /data/wxedge_storage needs to be changed to your own local path (or you can leave it unchanged)
Multiple instances#
docker run -d -e LISTEN_ADDR=":28888" --name=wxedge2 \
--restart=always --privileged --net=host \
--tmpfs /run --tmpfs /tmp \
-v /home/zyhahaha/wxy:/storage:rw \
onething1/wxedge
Related Links#
Register for Wangxin Cloud: This is a referral link, both the inviter and the invitee can receive coupons
https://act.walk-live.com/acts/invite?inviteid=51845cd2
Install Wangxin Cloud:
You can download it from the app store or register and download it through the link above.
Official Website:
https://www.onethingcloud.com/
Final Step#
After installing the app, access it in your browser
http://your_server_IP:18888
The following interface will appear, then use the app to scan the QR code in the browser to add the device.
Special Note#
Do not buy any of the products recommended on the app, including various hardware devices, just like the previous "Wanke Cloud". If you want to play, play the X86 Docker version (officially called "Container Magic Cube"), which is the deployment method introduced in this article. You don't need to buy any devices, just use idle servers to run it.
Docker Hub#
https://hub.docker.com/r/onething1/wxedge