Hi
I built a small CDN based on Pingora framework that Cloudflare create.

https://github.com/cloudflare/pingora

Pingora is a Rust framework to build fast, reliable and programmable networked systems.

The in-memory cache is very fast, the results are very cool. Performance results are very good, sometimes better than nginx. I have built several nodes in Europe.

Would anyone like to test on some non-production sites?

Write to my email adammakowski.dev@gmail.com and I will create a CNAME for you through which the files will be served and cached.

If you want to improve, add anycast addressing. CNAME @ root, is so hit/miss.

    Hi
    Small update.
    After many hours of testing, I have managed to come up with an interesting solution that can be applied to many sites.
    I created a proxy that can handle the traffic of sites through my servers, it works something similar to QUIC.cloud for example.

    A few details:

    1. in the easiest way you can set the website with the prefix ‘www’ to be served by my CNAME with the GeoDNS option. So, for example, in the DNS Enhance CP settings you change the www CNAME to the one I give you, let's say: proxy-website-dynoble.network. Then my servers create a www certificate for your domain and all traffic goes through my servers.

    2. this option allows you to reduce the load on your servers by up to 80% as traffic to your sites passes through the proxy.

    3. TTFB and latency are reduced because the proxy caches requests and allocates them to the appropriate servers in the respective countries, e.g. if you have a server in the USA and someone visits from the UK, the website is served by the proxy of my server in the UK.

    4. The proxy by default does not completely cache the entire website, which means that everything works just as it does on your local server, shops, adding to the shopping cart, changes to the website take place in real time without the need to clear the cache,

    5. It is also possible to set up a CDN cache for static files or pages which return a ‘Cache-Control’ header. This works very nicely as you do not need an additional CDN. I have tested it with the litespeed cache plugin and the results are satisfactory and everything works fine.

    6. I can also set up simple DDOS protection, e.g. allowing, for example, 200 requests per second from a given IP, Cookie, Header or Query.

    7. It is also possible to block IPs, User Agents or countries.

    8 I have now set up proxy servers in the UK - London, Germany - Frankfurt and Poland - Wroclaw

    Benefits.

    1. Web server based on Pingora and Rust. Performance is much better and latency is lower than nginx,
      very good benchmark material - https://www.youtube.com/watch?v=iz95STKZMqY
    2. Caching takes place in RAM using the TinyUFO cache - https://github.com/cloudflare/pingora/tree/main/tinyufo
    3. Pingora is very resilient to critical loads, does not crash or drop connections
    4. Currently only supports http2 with tls 1.1 - 1.3, http3 is in the plans.

    More:
    https://blog.cloudflare.com/pingora-open-source/
    https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/

    Is anyone interested in testing? 🙂

      a month later

      If anyone is still interested, you are welcome to test it.
      Discord @adammakowski

        AdamM
        Will you be able to make it open-source on Github ?

          AdamM
          I asked enhance to make CDN servers (1year ago)at enhance cluster but they said it’s very complex… and now you make it, pretty much in 24 hours including deployment of servers… nice one

            Kosta Adding a substantial feature and feat of orchestration to a product that doesn’t need a do it yourself CDN solution is redundant and a waste of time.

            DIY CDN(s), will never reach the scale, performance, uptime, reliability or quality of commercial solutions unless you have a spare million to spend on CI.

              adil No

              Kosta It's certainly not a professional CDN but it works.

              Zoinkies for me all is the same cdn, web , db, dns server it’s all same pretty much. As it’s all software app on a OS. So I don’t want to use any other hosting company for any services we can offer. I prefer they be all independent and reliability to be all on us not on 3rd party provider.
              Like cloudflare even if it’s good we be relying on them… pointless to be relying on others for our services. Build CDN into enhance please. In long term it be very profitable!
              Eventually we be paying monthly bills of 8k plus to enhance. I want CDN built in so instead paying cloudflare 40k a month we to make 40k a month by offering our CDN as Service… and be relying only on our DCs our Hardware our SOC team not cloudflare, aws, hetzner etc

              And the way I see it it’s again CDN software’s already built just need to be integrated and configured.
              My point of view.
              On top of that we gonna be protecting our services with that CDN ! I want my services up and running when cloudflare have outages…
              All probably think it’s too expensive to get CDN servers hardware in many locations around world but I think in long term it’s cheaper and much more profitable to be all on us.
              I am really for CDN into enhance. However even if enhance put it in their plans it be probably after 10 years rdy for production. Shocking I be dead by then probably or not interested anymore into this

                Kosta At your scale, yes a CDN would work, but 90% of people here aren’t at that scale. It’s impossible to cater for everyone and an integrated CDN for most won’t be great.

                Also, how the fuck are you spending 40k at Cloudflare, we were paying around 19k before we moved.

                Eventually as our customers get up the bills to 3rd party gonna be so high that we won’t be able to make good profit. Potentially we gonna have bills every month for 100k probably to 3rd parties like cf for CDN etc. if there is a 7 CDN servers 1 each continent etc we be paying monthly 1k a month to the DCs if we get our servers. Apart of the server hardware cost which should be operational for 5-10 years. So yeah I think with 10k customers we be paying a lot of money.
                CDN servers in enhance will make it possible to overtake cf with enhance very simple.
                I won’t use hosting companies to host our customers sites but I will use our hosting company to host our customers sites and give them best possible service without they to need ever to go to other hosting provider..

                This sounds as an amazing project! Do you consider turning this into a professional product or do you want to keep it non-professional as you said? If it is the second, it will be cool if you make its repo public so others can adapt it and commit to it.

                  vsmbg
                  For the time being, I am testing it on my own sites, on a small scale. To do it on a larger scale I need more servers.
                  If anyone would like to implement this at home, they can make their server available and I can help set it up.
                  For personal use only or can join to all servers (network).

                  Currently how it works:

                  • reverse proxy for websites using www cname, as is done for example by quic.cloud, this relieves the main servers on which the websites run
                  • the reverse proxy can have a cache enabled for static files which return cache-control headers
                  • cache on disk for up to 365 days
                  • config changes with auto-detection of changes and immediate change without having to reload the server as in nginx
                  • I am also thinking about how to solve the issue of synchronising caches from one server to another, something like a ‘global distrubted cache’.
                  • or only cache for static files without reverse proxy

                  In order to operate on a larger scale and offer services, I would have to build some kind of portal where everyone could set up CDNs and add new sites, which requires a bit more work.

                    AdamM when we made ours we used replicated s3 for cache storage. If that helps.

                      AdamM &/or, you could consider storing in distributed Redis or memcache

                      Zoinkies all of the things you have mentioned add extra latency, which does not work for CDN because there can be no extra delay. Redis also increases CPU usage and has large-scale restrictions, such as key limits. I've tested these things and they don't perform very well.

                        Kosta Yes, I know about that. There can be no additional delay.

                          Follow @enhancecp