Reducing VPS bandwidth usage means lowering the amount of data the instance sends or receives over a month, not making the network port “faster.” Port speed and a monthly transfer cap are different limits. If you still need that distinction, read the bandwidth vs port speed guide first, then come back here to find what is actually consuming transfer and cut it down.
This is a practical how-to for a Linux VPS that serves a website or an API. It does not rank CDNs or hosting plans. Measure first, then change the heaviest sources, and measure again.
Find the traffic before you squeeze it
The provider panel is the number that counts against a cap. On the VPS, vnstat and the web logs tell you which days and which paths moved the bytes:
vnstat -d
vnstat -m
sudo ss -tnp | head
# Nginx combined logs: largest response sizes
sudo awk '{print $10, $7}' /var/log/nginx/access.log | sort -nr | head -n 30
# most-requested URLs
sudo awk '{print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -n 30
Look at both volume and count. A single 2 GB backup copied off the box every night can outweigh a busy homepage. A popular video or a downloadable ZIP can outweigh all of your HTML. Bots that crawl the same large files all month can look like “user traffic” until you check user agents and source IPs.
Confirm whether the cap counts egress only or both directions. Package updates, inbound backups and image pulls can matter on a small cap. The Linux monitoring guide helps you watch the trend after you make a change, not only during a scare.
1. Stop shipping the same bytes from the VPS
Static files are the easiest win. Put images, CSS, JavaScript and downloads on a CDN or an object store, and let the VPS keep the HTML and the application. Cache-Control headers should match how often those files change:
# inside an Nginx location for versioned assets
location /assets/ {
access_log off;
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
}
Version the file names, or visitors will keep stale assets when you do change them. If you already have a CDN in front of the site, check that it is actually caching. A misconfigured origin that sends Cache-Control: no-store on images will keep charging you for every request.
Compress text responses on the origin too. Gzip is widely available; Brotli is better for HTML, CSS and JavaScript when the CPU cost is acceptable:
sudo nginx -V 2>&1 | tr ' ' '\n' | grep -E 'gzip|brotli'
# typical gzip settings in nginx.conf, then nginx -t and reload
# gzip on; gzip_types text/css application/javascript application/json image/svg+xml;
Do not compress files that are already compressed, such as JPEG, PNG, ZIP or mp4. You waste CPU and often gain nothing.
2. Shrink the pages themselves
Measure the weight of a typical page, not a blank template. Large hero images, unused scripts, and full-size uploads in blog posts add up faster than most people expect. Serve an appropriately sized image, prefer a modern format where the browser supports it, and lazy-load content below the fold when the site can do that safely.
If one file dominates the access log, fix that file first. A 40 MB PDF linked from the homepage, or a media library that still serves original camera uploads, will beat any gzip setting. The Linux VPS website guide is a reasonable place to keep the origin tidy once the heavy assets have a better home.
3. Keep backups and logs off the public path
Nightly full-disk copies over the public interface can consume a large share of a modest cap. Switch to incremental, compressed backups, and send them to another machine or to object storage on a schedule you can see. The backup and restore guide covers why the copy should not live only on the same VPS. If the provider offers snapshot storage that does not count against the transfer cap, use that for rollback and keep an independent copy anyway.
Access and error logs can also grow and then get pulled off the box. Rotate them, compress old files, and ship only what you need to retain. A full disk from logs is a different failure, covered in the disk full VPS guide, but the same files can cost you transfer when you download them every day.
4. Cut bot and scrape traffic you do not want
Not every request should be served a full page. Check the logs for a small set of IPs or user agents that fetch large paths repeatedly. Rate-limit or block the abusive ones at Nginx or at the firewall, and keep a path for real users and for search engines you actually want. A blanket block of all bots will hide the site from people you may still care about.
Hotlinking is another quiet leak: other sites embed your images and you pay for their views. Restrict by Referer only when you understand the side effects, because some browsers and apps send no referrer. A CDN with hotlink or token rules is often cleaner than a brittle origin rule.
If you stream or host large media, the cap problem is structural. Offload the media, or raise the cap. The streaming server guide is a reminder that sustained egress is a capacity issue, not a missing gzip flag.
5. Measure the change
After each change, wait long enough for cache and DNS to settle, then compare vnstat and the panel with the same days of the week, not a single quiet afternoon. Record what you changed. If transfer barely moved, the heavy source is still somewhere else: a second virtual host, a mail queue, a container registry pull, or an API that returns large payloads.
Do not “fix” an overage by shrinking the advertised port speed, and do not open extra ports hoping traffic will go elsewhere. Those are not transfer controls. If the useful traffic is simply growing, plan a higher cap or a CDN that bills on its own meter, and keep the origin lean.
Frequently asked questions
Will a CDN always reduce VPS transfer?
Only if it caches or serves the heavy files from its own network. If every request still hits the origin, you have added a hop without reducing egress. Check cache-hit rates and the Cache-Control headers you send.
Does enabling gzip reduce a monthly cap a lot?
It helps for HTML, CSS and JSON. It does little for images, video and already compressed downloads, which are often most of the bytes. Start with the access-log heavy hitters, not with gzip alone.
Can I just block all crawlers?
You can, but you may also block monitoring, payment callbacks, or search engines you want. Block or rate-limit the specific sources that pull large files repeatedly, then re-check the logs.
My cap includes inbound traffic. What should I change?
Look at inbound backups, package mirrors, container pulls and large uploads. Pull packages from a nearby mirror, avoid re-downloading the same images, and receive backups on a path or plan that does not waste the cap you need for the website.
How soon will I see a difference in the panel?
Sometimes the same day, if you just stopped a nightly multi-gigabyte copy. For a website, compare a week to a week. Daily noise and a mid-month traffic spike can hide a real improvement.