server, servers, data

No more VPS

A little of history

For a really long time I was using Contabo VPS as my main server. I was really happy with it. Good thing was, I bought it long time ago, before changes in packages, so I had few cores more then you may have right now for the same price. Similar story was with system memory. Ok, disk storage was lower then you will get now, but it wasn’t important for me. In my case, most of the space is used by images, and all of them are offloaded into S3 bucket anyway.

S3 and Ccloudflare

Because I’m using S3 bucket as a storage for offloaded images, I don’t need a lot of space and transfer. But… if I will serve images directly from S3, it will not look nice from the url point of view. So I mixed S3 (as storage) and Cloudflare with custom sub-domain (as CDN – Content Delivery Network).

A Content Delivery Network (CDN) is a system of distributed servers that deliver web content and pages to a user based on the geographic locations of the user, the origin of the webpage, and a content delivery server. This service is effective in speeding up the delivery of content on websites with high traffic and websites that have global reach. The closer the CDN server is to the user geographically, the faster the content will be delivered.

A CDN works by caching content in multiple locations around the world. CDN servers are typically located in data centers across different continents to ensure a quick delivery of web content to users no matter where they are.

Here’s a simplified breakdown of the process:

  1. A user requests a webpage (e.g., by clicking on a link).
  2. The request is redirected to the nearest CDN server.
  3. If the CDN server has the content cached, it delivers it directly to the user.
  4. If not, the CDN server will request the content from the origin server or another closer CDN server, cache it, and then deliver it to the user.

This reduces latency because the content is sent from a closer source rather than from the origin server which could be much further away. It also reduces load times and can help handle high traffic loads more efficiently.

Migration

S3+Cloudflare were the main reason why I decided to migrate frm VPS into my own server.
I know my home connection is not the same class as the business connections, it has a different SLA and priority in case of issues, but I’m not hosting anything critical 🙂 Only my blog and similar things. Because of CDN+S3 most of the traffic (images) are not served from the server where the page is anyway, so this reduce the traffic. I also have dynamic IP from my provider, but here cloudflare tunnel was the solution.

Cloudflare Tunnel is a tunneling software that secures and encrypts application traffic to any infrastructure. It allows you to hide your web server IP addresses and block direct attacks. A lightweight daemon called cloudflared creates outbound-only connections to Cloudflare’s global network, which means your resources can connect to Cloudflare without a publicly routable IP address. This setup helps protect your origins from attacks that could bypass Cloudflare, and it supports various protocols like HTTP, SSH, and remote desktops. Which is nice, I also replaced Nginx Proxy Manager with Cloudflare Tunnel.

Current state

I’m hosting all my web pages from my garage. I’m using the same HP server which is my NAS and media center at home 🙂 and, to be honest, it’s not something what may make this server hot:

[fox@foxbang ~]$ top -b -n 1 |grep -i cpu
%CPU: 4,3 us, 1,1 sy, 0,0 ni, 93,5 be, 0,0 io, 1,1 hi, 0,0 si, 0,0 sk
PID USER PR NI SWAP RES WSP S %CPU %MEM TIME+ COMMAND
23 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/0
24 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/1
30 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/2
36 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/3
42 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/4
48 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/5
54 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/6
60 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/7
[fox@foxbang ~]$

The biggest issue for me is a memory usage. Maximum what you can put into HP Microserver 8gen is 16GB. And my current usage is about 11GB, which gives me marging about 5GB. It’s still not bad, as my OS is not using any swap at the moment, but sooner or later, if I will add something more here, I will have to think about replacement for my current hardware. But I will worry about that in the future, when time will come 🙂

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.