Step 1: Measure your Ubuntu VPS before changing anything
sudo apt install htop sysstat
htop # CPU, memory and the busiest processes
vmstat 1 10 # run queue, swapping, I/O wait, steal
iostat -x 1 5 # per-disk utilisation and latency
free -h; df -h
What you see decides what to tune:
| Observation | Likely bottleneck | Focus on |
|---|---|---|
| CPU near 100% in user time | Application code | OPcache, caching, worker counts, more vCPUs |
| High I/O wait | Disk access | Database buffer pool, caching, fewer writes |
Swap in use, si/so non-zero | Memory | Fewer workers, smaller buffers, or more RAM |
High st (steal) | Host contention | Provider; see CPU steal time |
| Everything idle but pages slow | Network, DNS or the application waiting on something | Application logs, external API calls |
Also record a baseline from outside: time a few page loads, or run a simple load test, so you can tell whether each change helped.

Step 2: Update and remove waste
sudo apt update && sudo apt full-upgrade
systemctl list-unit-files --type=service --state=enabled
If you installed a desktop for a Linux VPS with GUI setup, remember it uses memory even when nobody is connected. Disable services you do not need, for example a mail server you never use, or snapd if you install nothing from snaps:
sudo systemctl disable --now service-name
Limit how much disk the journal can take, which also keeps log searches quick:
sudo sed -i 's/^#\?SystemMaxUse=.*/SystemMaxUse=500M/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
Step 3: System settings that actually help
Swap and swappiness
A small swap file (1–2 GB) prevents sudden out-of-memory kills during spikes. Lower swappiness so the kernel prefers keeping applications in RAM:
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/60-swappiness.conf
Swap is a safety net. If the server swaps constantly, it needs less memory use or more RAM, not more swap.
TCP BBR congestion control
BBR often improves throughput for users on long or lossy paths, such as visitors on mobile networks or in other countries:
printf 'net.core.default_qdisc=fq\nnet.ipv4.tcp_congestion_control=bbr\n' | sudo tee /etc/sysctl.d/60-bbr.conf
sudo sysctl --system
sysctl net.ipv4.tcp_congestion_control
Open-file limits for busy services
High-traffic Nginx or database servers can hit the default limit on open files. Raise it per service with a systemd override rather than globally:
sudo systemctl edit nginx
# add:
[Service]
LimitNOFILE=65535
Settings that rarely help on a modern Ubuntu VPS include changing the disk I/O scheduler (virtual NVMe disks already use a suitable default), dropping caches with drop_caches, and pasting long lists of network sysctls without measuring. Ubuntu's own Ubuntu Server documentation is a better reference than copied tweak lists.
Step 4: Tune the application layer
PHP: OPcache and PHP-FPM workers
OPcache stores compiled PHP in memory and is the biggest single win for WordPress, Laravel and other PHP sites. Check it is enabled with php -i | grep opcache.enable, and give it enough memory in the FPM php.ini:
opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
Then size PHP-FPM workers to your RAM. If each PHP process uses about 60 MB and you can spare 3 GB for PHP, set pm.max_children to about 50. Too many workers causes swapping, which is slower than queuing requests. If you are not sure which php.ini the web server reads, see how to find and edit php.ini.
Nginx
worker_processes auto;to match vCPUs.- Enable gzip (or Brotli) for text assets, and long cache headers for static files.
- Serve static files directly from Nginx rather than through PHP.
MySQL or MariaDB
On a server dedicated mostly to the database, set innodb_buffer_pool_size to 50–70% of RAM; on a server shared with a web stack, considerably less. Turn on the slow query log to find the queries worth indexing. Our database tuning guide goes further.
Caching
Redis for object caching, and full-page caching for content that is the same for every visitor, often reduce server work more than every system tweak combined.
Step 5: Keep it fast
- Automatic security updates with
unattended-upgrades, plus planned reboots for kernel updates. - Monitoring of CPU, memory, disk and response time, so you see slowdowns before users do.
- Log rotation and at least 20% free disk space.
- Regular checks for malware and unexpected processes; see scanning with ClamAV.
- A troubleshooting routine for when something does go wrong; our VPS troubleshooting guide lists the commands.
Why developers choose SkyRain Cloud VPS
Tuning helps most on hardware that is not holding you back. SkyRain Cloud Intel VPS plans include:
- KVM virtualization. Your own kernel and allocated vCores, so you can tune the system the way this guide describes.
- Intel Xeon Platinum 8269CY hosts. Server-class Cascade Lake CPUs with DDR4 ECC memory.
- NVMe SSD storage on every plan, which keeps I/O wait low for databases and builds.
- Full root access to install and configure whatever your stack needs.
- Unmetered 1 Gbps port in India, close to your users.
- Simple billing and real support. Monthly billing in rupees with UPI, plus 24/7 tickets, WhatsApp and Discord.
Frequently Asked Questions
How can I make my Ubuntu VPS faster?
What swappiness should I use on a VPS?
Should I enable TCP BBR on Ubuntu?
How many PHP-FPM workers should I run?
Do sysctl tweak lists from the internet help?
When should I upgrade instead of tuning?
Conclusion
Optimising an Ubuntu VPS is mostly about measuring, then fixing the real bottleneck. Remove unused services, add a small swap file with low swappiness, enable BBR and raise file limits where needed, then spend most of your effort on OPcache, PHP-FPM sizing, the database buffer pool and caching. Re-measure after each change, and when tuning no longer helps, the data will show you which resource to upgrade.
For a fast starting point in India, see our Intel VPS plans.
SkyRain Cloud Intel Xeon VPS Plans
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRain Cloud store (verified 2026-11-23). Live stock and final price are shown at checkout.