I want to know what aspects in VPS hosting packages are related to performance for the website which will make it faster in loading for the end useres. And does RAM really matter?
closed as too broad by user40980, GlenH7♦, Kilian Foth, Bart van Ingen Schenau, amon Feb 19 '14 at 16:16
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Here are the main ones in order of best improvement for time spent. Some of these will be more of a bottleneck depending on what data you're dealing with.
Front End: There are easy wins on the front end. Cut down the number of requests with image sprites and aggregating css/js files. Make sure gzip and cache headers are being used.
Hardware: Hardware can be cheap compared to your time. Throw more ram at the problem. Perhaps put your database on another server to cut down disk io.
A CDN is an easy option for this. 0.1 seconds is considered to be fast in usability. I'm in Australia so you've probably lost me no matter how fast you serve up the files.
Server side caching: Setup a reverse proxy, it's much more efficient to have Nginx serving pages to slow mobile connections than have a heavy apache process waiting idle for the response to finish.
Memcached is an easy way of caching things in memory for fast retrieval.
Database Tuning: Keep track of what queries are running slow. Add indexes on the columns you are using. Cut down the number of joins by denormalising where appropriate. You'll need to put the database on a second server at one stage. A lot of RAM can help as the indexes can then be kept entirely in RAM.
If you're interested in clustered hosting I would look at some of the presentations from facebook and youtube, wikipedia engineers on how they've done it.
edit some videos: Youtube scaling: http://video.google.com/videoplay?docid=-6304964351441328559# Django/General Scaling workshop: http://python.mirocommunity.org/video/1689/pycon-2010-django-deployment-w
Also one thing I may have forgot was if you have search a dedicated search engine like Solr/Sphinx can help.
In my experience RAM makes more difference with databases/datastores than with webservers.
Unless you have a complex web application, go for processing power since that would impact performance more than memory!
Edit> I base my experience working with seperate web- and database servers. The web server hardly used any memory while the database server had to be configured so that the RAM basically was a RAM-disk.
With processing power I mean what CPU you are using; processing speed, number of cores. If you have a database on the same VPS then you can consider to add more RAM since that would impact it's performance.
If you're starting out, it really doesn't matter anyway because you need the traffic first anyway. Only when the site is becoming slow and unresponsive is when you should worry about optimization.
That varies hugely depending on what you are going to run on the server.
For a web server you only need a reasonable amount of RAM, it doesn't make a big difference to use more. For a database server more RAM is better, there is really no upper limit until you have room in memory for caching all data in the databases and all common results.
The factors that makes a site load faster are generally:
- The amount of data
- The speed of the transfer
- Server response time
- Number of requests
The factors that makes a site seem to load faster are more complex, some important are:
- Loading what's needed for initial display before the rest of the data
- A page layout that needs minimal data for the initial display
- Placeholders for content (e.g. images), so that the layout doesn't change much when content loads
- Reaching UI responsiveness early
RAM matters hugely.
The usual suspects apply: how many cores are on the machine, the speed of the cores, the number of VPS sessions, the number of concurrent website users, etc.
I would guess that more RAM is probably the most significant first thing you can do to increase performance. RAM affects your ability to cache, your ability to serve pages; RAM affects everything.
There are hardware and software aspects:
Hardware: A starting point is going to be a single server with capable hardware - lots of RAM, multi-CPU system, high performance disks, multiple disks (separate OS, swap and data disks), multiple network cards (lots of incoming connections). Once you're beyond one large machine, you're going to be looking at multiple machines and load balancing solutions. Splitting out the database to a separate server with tons of RAM will help to a degree, but you'll soon need to add additional web servers.
Where to invest depends on your web application and its' usage profile - measure the performance, response, utilisation, etc, and scale accordingly.
After this, you're going to be looking to spread servers around the globe, perhaps leveraging Content Distribution Networks to capitalise on their setup first.
Software: Proper server caching settings for the pages you serve will make a massive difference to your users and your bandwidth costs. Modern web browsers can cache all the JS and images that your site has. If you can structure your site to be as cache-able as possible, with the least number of dynamically-built pages, the better.
Use the Developer Tools in your browser to explore a popular site and see how they achieve great response.
you can also use a tool like https://developers.google.com/speed/pagespeed/insights
which will tell you how to opertimize you site to preform faster