Introduction
According to Google’s SOASTA Research of 2017, the probability of bounce increases 32% as page load time goes from 1 second to 3 seconds. Basically, this means two things: your website should load in less than 3 seconds, and it’s much better if it loads in 2 seconds or 1 second. For most users, how to make this happen is a big challenge. This article is out to teach you exactly how to use Fast VPS Hosting to achieve that and win your visitors – who are your potential customers – at first sight. Sites that load faster will sell more than sites that load slower.
About a Study We Conducted on Fast VPS Hosting
A few weeks ago, we conducted a practical study to determine what amount of traffic a specific VPS can hold. Our conclusion was that, to host about 250 concurrent users on your website, you need a Fast VPS Hosting with 4core CPU and 8GB RAM – assuming you do not do any optimizations on your server.
What this means is, with the same resources, you can actually host a much bigger number of visitors if you optimize your website. We will go through several things you need to optimize to increase your performance and reduce costs.
The Five Secrets to Speed Up Your Website Using Fast VPS Hosting
There are 5 aspects of your hosting you need to optimize for great speeds.
Webserver Configuration
The first crucial move is to use fast VPS Hosting powered by Nginx or Litespeed web server. These are webservers built for speed.
To configure Nginx to handle 500 concurrent users, you can adjust various settings to optimize its performance and handle the increased load. Here are some key configuration settings to consider:
Worker Processes
Set the number of worker processes in the nginx.conf
file. The optimal value depends on your server’s hardware capabilities, but you can start with a number equal to the number of CPU cores available. Example:
worker_processes auto;
Worker Connections
Configure the maximum number of connections each worker process can handle simultaneously. Increase this value to allow more concurrent connections. Example:
events {
worker_connections 1024;
}
Keepalive Connections
Adjust the keepalive timeout and the maximum number of idle keepalive connections to conserve system resources and improve performance. Example:
http {
keepalive_timeout 60;
keepalive_requests 1000;
}
Buffer Sizes
Tune the buffer sizes for handling large volumes of data and optimizing network performance. Example:
http {
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 4 32k;
}
Gzip Compression
Enable gzip compression to reduce the size of HTTP responses and improve transfer speeds. Example:
http {
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_types application/javascript application/json text/css;
}
Static File Caching
Configure Nginx to cache static files, such as images, CSS, or JavaScript files, to minimize the load on the backend server. Example:
http {
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
inactive=60m use_temp_path=off;
server {
location / {
proxy_pass http://backend;
proxy_cache my_cache;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
}
}
}
Database Configuration
In this case, we’ll assume you use MySQL. You can apply the equivalent settings for other databases such as Postgres.
To optimize MySQL for heavy load and improve its performance, you can adjust the following settings in my.cnf file
- Max Connections:
Increase the maximum number of concurrent connections allowed by MySQL to handle the heavy load. Example:
max_connections = 500
- Key Buffer Size:
Adjust the size of the buffer used for caching index blocks for MyISAM tables. This can improve the performance of index lookups. Example:
key_buffer_size = 256M
- Query Cache:
Enable the query cache to store the results of SELECT queries in memory, reducing the need to re-execute the same query. Example:
query_cache_type = 1
query_cache_size = 128M
- Table Cache:
Increase the table cache size to allow MySQL to keep more tables open simultaneously. This can be beneficial if you have a large number of tables. Example:
table_open_cache = 2048
- InnoDB Buffer Pool Size:
Adjust the size of the buffer pool used by InnoDB, which caches frequently accessed data and indexes. This is important if you’re using InnoDB as your storage engine. Example:
innodb_buffer_pool_size = 1G
- InnoDB Log File Size:
Increase the size of the InnoDB log files to improve write performance and reduce the frequency of log file flushes. Example:
innodb_log_file_size = 256M
- Temporary Table Size:
Increase the size of the temporary table memory cache to avoid disk-based temporary tables, which can significantly impact performance. Example:
tmp_table_size = 64M
- Max Allowed Packet:
Adjust the maximum allowed packet size to accommodate larger queries or data transfers. Example:
max_allowed_packet = 64M
Network Traffic Configuration
Incoming network traffic can be a hindrance to your website load speed. Remember, not all traffic coming into your website is good. Some traffic is simply sent by malicious actors as an attack on your site to deny your legitimate users a good experience. This is done through bots, and such traffic needs to be blocked out. There are a combination of several techniques you can apply on your website to safeguard it against attacks. This includes Rate Limiting, Behavioral analysis, IP address filtering, and user agent filtering.
However, we recommend simply using Cloudflare. Cloudflare is a DNS service provider that also provides several other services for your website. By integrating your website with Cloudflare DNS, you automatically apply very many security features that protect your site from malicious traffic. This guide will assist you in connecting your website to Cloudflare.
Caching Configuration
Caching is very important for any modern site. It reduces the load time by ensuring some resources are fetched from memory instead of disk. Caching should be applied both at database level and static file eg CSS and JS files. If you use WordPress, several plugins already exist to make this possible. This include W3Total Cache, Litespeed Cache(requires Litespeed Webserver) and more.
If you use a custom made website, try to integrate Redis or Memcached on your website/application to make use of caching technologies.
Use Fast Storage
NVMe Disks are the fastest disks now with speeds of upto 3500Mb/s compared to just 160Mb/s for traditional HDD. When selecting storage for your website, make sure its NVMe to get the best speeds. With Truehost, this is already catered for as our VPS run on NVMe Disks.
Getting Started with Fast VPS Hosting
To get started on this journey, you need to acquire a VPS. We recommend Tcloud VPS 2 as you start. This one provides 1 core, 2GB RAM, and 60 GB of NVMe type storage (fastest disks currently). You can always upgrade to higher plans as traffic demands.
If you already have 500 concurrent users on your site, we recommend Tcloud VPS 3. With that and the optimizations above, you’ll spend 100% of your time growing your blog or business as traffic will be handled well.
Check out range of Fast VPS Hosting plans below. Performance, Stability, Afforability and Round the Clock Customer Support
Fastest Cloud Servers – LiteSpeed Servers
Data Migration to VPS/Shared Hosting
No renewal fee.
- Get Data Migrated to VPS/Shared Hosting
- Optimum Software Set up
- Optimum Security Configuration