Deplyoing with Heroku/Shared Hosting/GitHub Pages - heroku

My Jekyll website is currently powered by a shared web hosting plan from HostGator with unlimited disk space & bandwidth. I have also enabled CloudFlare for the site.
I've heard about Heroku which hosts websites for free and GitHub Pages. I won't exceed 2TB bandwidth/month nor do I need more than 300 MB space so I comply with both GitHub Pages & Heroku's limitations.
Which of the following will serve the website fastest to users (and with the max uptime)?
Shared web hosting (I deploy via rsync)
GitHub Pages
Heroku
I think shared web hosting is slower than Heroku or GitHub Pages. So, what should I use? Is GitHub Pages faster than Heroku with 1x dyno?
My website gets about 15k pageviews/daily.

GitHub Pages uses Fastly, a CDN, to deliver its content. Unless you're using a similarly fast and efficient caching system, you'll see that GitHub Pages is fastest.
Jeremy Morgan wrote a great piece some time ago wherein he compared GitHub Pages to several other services. He found that GHP is the fastest of the four services he tested and recommends GHP. He doesn't have any data on Heroku, but setting up your site to work with Heroku shouldn't take that long. You can compare speed with webpagetest.org, as Jeremy suggests.
If your 15K pageviews see a lot of overlap (i.e. mostly the same collection of pages/assets being loaded), then you'll find that Fastly on GHP offers you better page load times than other services.

Related

Free images hosting with CDN

I am looking for free solution to image hosting with CDN. I got website on small paid hosting and there will be lot of image galleries which I would like to upload to some cloud like Google Drive and use cloud's CDN to link images on my web. Any recommendations for free solution ?
CDN and cloud storage like Google Drive are two different things.
A CDN can be defined as:
A content delivery network or content distribution network is a
geographically distributed network of proxy servers and their data
centers. The goal is to provide high availability and high performance
by distributing the service spatially relative to end-users.
Where as cloud storage services provides highly available and secure storage space over the cloud. Here is a link which explains the difference of these two in terms of AWS(CloudFront vs S3).
If your website traffic is moderate and you want to use free CDN, then you may signup for AWS free tier. The free tier gives you 50 GB Data Transfer Out and 2,000,000 HTTP and HTTPS Requests for Amazon CloudFront(AWS CDN) each month for one year. Here's a tutorial for getting started with AWS CloudFront
If you intended to use cloud storage services then also the free AWS tier provides you with 5 GB of space in AWS S3 for 1 year.
Apart from AWS free tier you may also like to checkout free Microsoft Azure or Google Cloud Platform. Levering these free tier resources it's even possible to host your current website on these platforms almost for free given the usage is within free tier limits.

Moving websites to Github - what about email?

I'm thinking of moving about 5 websites over to be hosted on Github pages from a dedicated host. They will all be converted to static websites. The domain names will still be managed there, what are some options for email hosting cheaply or at all?
I've always gone with Google's G Suite.
The basic plan gives 30GB of storage, and costs $5/User/Month
The business plan gives Unlimited storage, a few more features, and costs $10/User/Month
There's also an enterprise plan, but I don't think you'd need it.

Is it good to save a large file in ram for a while?

So I have a bunch of videos hosted on dropbox, and I have to build a web app for my client that get those videos from dropbox and upload them to youtube, I've came with the following solutions :
First : Once my app got a dropbox link, it use the API to download it on the server filesystem, after that it will use the youtube API to upload it
Problem with this : The only problem I will face here, is that I'm hosting the app on heroku, and heroku has an ephemral filesystem which is not that good for storing files, also videos could be large exceeding 100mb and that's not allowed by heroku .
Solution : I can keep the file on the ram, which is around 512 mb for a free dyno and agter uploading to youtube I delete it !
So my basic question here is whether it'd be good to save a large file in RAM for some time ?
Definitely not a good idea. What if you have a few people downloading videos in parallel?
It looks like you need a worker dyno for your app, that would do the actual downloading and free up your web dyno.
You need to keep all your dynos stateless and disposable, and so should use some kind of backing service such as Heroku Redis for storing your videos.
This blog post might give you some ideas.

Linode VPS Capabilities

I have no experience with VPS's. Over the past year or two I've been getting more and more into web development, as a hobby and for work. I'm currently managing one wordpress site, a codeigniter app, a node.js/mongodb app, and various other personal projects. They are currently all hosted seperately (misc LAMP hosting, heroku, etc.).
I'm looking for a solution that will enable me to do the following:
Host Static/PHP Sites/Apps (so a LAMP stack)
Node.js/MongoDB/Redis
capable of other stacks (django/yesod/RoR/etc.)
Would a Linode VPS be capable of handling all of this? None of these sites get large amounts of traffic. The web apps are private, business management apps, used by 2-10 people at a time. The public sites are small business websites and my portfolio. I would like to be able to host future work on the same VPS as well (same types of small sites/apps).
I have no experience managing multiple domains on the same server. Is this easily done (or possible) with a single Linode VPS?
EDIT
I'm looking at the Linode 512MB/1GB VPS's, $20/$40 respectively.
Of course.
Especially after the massive Linode NextGen upgrades, a Linode VPS can easily handle this kind of workload. Since it's a VPS and not merely shared hosting, you get root access and therefore full control over the system.
In addition, Linode includes features such as advanced disk image management that allows you to clone and resize disk images as required and quickly boot into different images, as well as an out-of-band shell that allows direct access to the server's console in the event you cannot access it via SSH. A Linode 1024 (1GB) plan is more than enough for this sort of workload.
There are lots of different VPS providers out there. Rackspace is very expensive but probably has the highest level of reliability (100% uptime SLA with 5% refund per 30 minutes downtime) and outstanding "Fanatical Support". For less critical needs, there are loads of smaller VPS providers that offer cheap rates, but often with only minimal resources and fewer features. Some provide super-fast SSD storage for disk-intensive applications. You should shop around and do your research so that you find a VPS provider that meets your requirements.
I suggest that you may look into a shared hoisting plan on a reputed hosting companies like hostgator since there isn't much traffic.I also suggest you also buy a cpanel for managing tools.Cpanel has a web interface with which you can control every tool using your mouse & keyboard.
On the other hand linode has a CLI interface and their support expects you to have some descent knowledge about managing VPS servers.

Will Heroku be cheaper than my current VPS + Reseller setup?

Thanks to Michael Hartl's tutorial on rails, this amazing community, and twilio, I was able to learn rails and build my first app this month.
I love the the git/heroku workflow, and got thinking --
Currently I have,
~20 light PHP sites on a VPS I pay $40/month for
~10 light PHP sites + 2 Wordpress installs on a Shared Reseller Account I pay $20/month for
+1 App I just made
The PHP sites are basically static sites that have php_includes in them, to make the code a little bit less repetitive.
I'm a little confused by the Heroku pricing though, because I'm not sure how many requests constitutes one dyno, etc.
For the light PHP sites, does using Heroku make sense?
Say that all together the PHP sites get about 5000 views a month, out of which 2000 is for wordpress.
How much do you think it's going to cost me to have them up and running?
Heroku will answer - this is cloud and you should not think in terms of Servers or VPS but more Dynos etc. But old habits die hard :-)
For your question, very simply a Dyno has 512 MB memory (RAM), and the cost of a Dyno includes the bandwidth and the disk space you are using. There are many other issues, like Dynos being Read Only and transient, no IP assignment etc.
In your specific case, definitely use Heroku for your Rails testing, and hosting. Heroku provides hosting free for one Dyno. (Each additional Dyno - about USD 34/month)
For your static sites and PHP, why don't you use AWS with the free tier, you get your own server/vps with whole lot of other services free - http://aws.amazon.com/free/

Resources