ninetian / pseudo-cdn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from blakelymadden/pseudo-cdn
A simplified CDN that uses distributed networking to hasten content delivery
This project forked from blakelymadden/pseudo-cdn
A simplified CDN that uses distributed networking to hasten content delivery
This repository contains a framework for rolling your own pseudo-CDN given you have access to available servers. Requirements: - An "origin" server that contains web content to be fetched - One or more server nodes that you have user level access to - One server to host a DNS Server (provided in the framework) - POSIX compliant machines Bash scripts, for easy deployment, running, stopping, and removal of software to remote servers, are provided. In order to use these scripts effectively, and without (much) modification, the following usage applies: - ./[run|stop|deploy|remove]CDN -p <port> -o <origin> -n <ipfile> -u <username> -i <ssh-keyfile> - Modification of the "dnsserv" variable in each script is required. The current URL will not work for non Northeastern students. - In order to use these scripts, you must first copy your public SSH key to ~/.ssh/authorized_keys on each remote server. In order to make this as easy as possible, I've included a script for ssh key distribution from your local machine. - Finally, you must use the same username for each remote machine if you want to use these scripts effectively. You can modify these scripts, or manually deploy the code if you are unable to meet this requirement. After running the deploy script followed by the run script, you can test the network by using the following sequence of commands: IP=`dig +short -p <port # used in scripts> @<dnsserver> someurl.example.com | head -1` (you should receive the IP address of one of the nodes in your network) wget $IP/<path to some page on origin server>:<port # used in scripts> You now have a file in your directory with the name of the webpage you queried. You might be thinking to yourself, "Hey, nobody browses the web like this, what gives?" Well this process is basically what happens behind the curtains when you use a web browser to navigate to pages being served by a CDN. Since this is just an experiment for me to get my feet wet in this whole domain, it doesn't support the UX features of a real CDN. Pseudo-CDN is basically useless in practice, but it serves as an experiment in understanding how CDNs work in the real world. This is a simplified version of a CDN, but the core components of a real CDN are present. Namely, this framework implements a DNS server that redirects questions to a server in the CDN that is chosen as the best server to fulfill that request (the current implementation simply distributes requests evenly among the machines in the CDN - obviously not a real solution to finding the server with the best response time. This is just a placeholder until a real policy is implemented). A real policy will take an active measurement approach to actually keep track of which server will decrease lookup time for a given client. TODO: - Reimplement the DNS redirection policy to support some form of active measurement on the network. - I haven't really looked through the HTTP server code, so I need to take a sweep and refactor some or most of it. - Handle signals from killall gracefully. Currently zombie processes are created and files are not properly closed. The HTTP server (in the file called httpserver) implements a caching policy under a 10MB memory constraint. The caching methodology keeps track of the most requested pages and uses an eviction policy based on these numbers. This enables faster lookup time for highly requested pages. httpserver is written primarily by github.com/zachnu with some minor modifications by github.com/blakelymadden. Everything else is written by github.com/blakelymadden
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.