Bandwidth management on Cloud VPS: optimize usage
Monitor bandwidth usage, reduce data transfer costs, implement throttling, use CDN, and optimize server efficiency.
On this page
Bandwidth is the amount of data transferred between your VPS and visitors' browsers. Every image viewed, file downloaded, or API call uses bandwidth. Monitoring and optimizing bandwidth reduces costs and improves performance.
How bandwidth is measured
- GB (Gigabytes): 1,000 MB. A typical web request = 2-10 MB
- Measured monthly: Total data in + data out
- Inbound: Requests from users and API calls
- Outbound: Response data (HTML, images, files)
- Internal: Data between your VPS and other servers (often free)
Example: A 5MB image viewed 1,000 times = 5GB outbound bandwidth
Monitor your bandwidth usage
Via VPS Control Panel
- Log in to your VPS control panel (Virtualizor, etc.)
- Click your VPS
- Look for "Bandwidth" or "Traffic" statistics
- Check daily/monthly usage graph
Via command line (VPS with root access)
# Install vnstat (bandwidth monitor)
sudo apt-get install vnstat
# Check daily bandwidth
sudo vnstat -d
# Check monthly
sudo vnstat -m
# Real-time traffic (iftop)
sudo apt-get install iftop
sudo iftop -n # shows bandwidth per connection
Ways to reduce bandwidth usage
1. Compress images (biggest impact)
- Use JPG for photos, PNG for graphics
- Compress before uploading (TinyPNG, ImageOptim)
- Use WebP format for 25-35% size reduction
- Lazy load images (load on scroll, not on page load)
2. Enable gzip compression
Compresses HTML, CSS, JavaScript before sending to browser:
# Nginx
gzip on;
gzip_types text/html text/css application/javascript;
3. Cache aggressively
- Browser cache (tell browsers to cache locally)
- Page cache (cache rendered HTML)
- CDN cache (cache at global edge locations)
4. Remove unnecessary data
- Delete old backups and logs
- Remove unused plugins/themes
- Minify CSS and JavaScript
- Remove tracking pixels and analytics bloat
5. Implement rate limiting
Prevent bots and scrapers from consuming bandwidth:
# Nginx rate limiting
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
limit_req zone=api burst=20;
Using a CDN (Content Delivery Network)
A CDN caches static content (images, CSS, JS) at servers near your visitors, reducing bandwidth from your VPS:
- Cloudflare: Free tier, good for most sites
- AWS CloudFront: Pay-per-use, scalable
- Impact: Can reduce outbound bandwidth by 40-70%
Bandwidth throttling
Limit per-user or per-connection bandwidth to prevent single users from dominating:
tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit latency 400ms
Choose the right bandwidth plan
- Small site: 500GB/month sufficient
- Medium site: 1-2TB/month
- High traffic: 5TB+/month or unmetered
- Overages: May incur charges; monitor usage
Related: Performance tuning | CDN optimization
Need a Cloud VPS?
Launch an UnderHost Cloud VPS when your workload needs root access, scalable resources, and full server control.





















