Stop Burning Cash: A Pragmatic Guide to Cloud Cost Optimization in 2017
There is a dangerous myth circulating in boardrooms from Oslo to Bergen: "Move to the public cloud, and you only pay for what you use."
It sounds perfect. But if you have been running production workloads on AWS or Azure for more than six months, you know the reality is different. You aren't paying for what you use. You are paying for what you provisioned and forgot to turn off. You are paying for egress bandwidth you didn't anticipate. You are paying a premium for "guaranteed" IOPS that would be standard on a decent bare-metal server.
As we head into 2017, with the General Data Protection Regulation (GDPR) enforcement date looming next year, efficiency isn't just about saving money. It's about control. I have audited infrastructure for Nordic fintechs where 30% of the monthly bill was wasted on idle resources and inefficient storage tiers.
Here is how to stop the bleeding, reclaim your budget, and why a predictable, high-performance VPS strategy often beats the hyperscaler markup.
1. The "Zombie Instance" Audit
The first step is ruthless identification of zombie assets. These are dev environments left running after a sprint, or staging servers that no one has logged into since November 2016. In a virtualized environment, these consume CPU cycles and RAM reservation.
Do not guess. Measure. If you are managing a fleet of Linux servers, you need centralized monitoring. But for a quick audit, I use a simple iterative script using sar (System Activity Report) to flag underutilized nodes.
Install sysstat if you haven't:
yum install sysstat -y # CentOS/RHEL
apt-get install sysstat -y # Debian/Ubuntu
Here is a bash snippet I use to check average CPU load over a 1-hour period. If it's consistently below 5%, you are burning money.
#!/bin/bash
# Audit CPU usage history
echo "Checking CPU utilization for $(hostname)..."
# Pull average %idle from the daily report
IDLE_AVG=$(sar -u | grep Average | awk '{print $8}')
# Bash doesn't do floating point math natively easily, so we use bc
USAGE=$(echo "100 - $IDLE_AVG" | bc)
if (( $(echo "$USAGE < 5.0" | bc -l) )); then
echo "[WARNING] Zombie Alert: Average CPU usage is only ${USAGE}%."
echo "Consider resizing or terminating this instance."
else
echo "[OK] Instance is active. Usage: ${USAGE}%"
fi
The Fix: For non-production environments, automate shutdown. At CoolVDS, many of our clients use Ansible to shut down dev environments at 18:00 CET and wake them up at 07:00 CET. That alone cuts runtime costs by ~60%.
2. The Hidden Tax of Storage I/O
This is where the hyperscalers get you. You spin up an instance, but if you need high disk throughput for a MySQL or PostgreSQL database, you have to pay extra for "Provisioned IOPS" (piops).
If you are running a Magento store or a high-traffic WordPress site, disk latency is your bottleneck. Standard magnetic storage or cheap network-attached SSDs throttle your database queries.
In 2017, NVMe (Non-Volatile Memory Express) is the game changer. Unlike SATA SSDs which were designed for hard drives, NVMe connects directly via the PCIe bus. The difference in latency is not small; it is an order of magnitude.
Benchmarking Your Storage
Don't trust the marketing brochure. Run fio to see what you are actually getting. Here is a test for random write performance, which is critical for transactional databases.
fio --randrepeat=1 \
--ioengine=libaio \
--direct=1 \
--gtod_reduce=1 \
--name=test \
--filename=test_file \
--bs=4k \
--iodepth=64 \
--size=4G \
--readwrite=randwrite
On a standard public cloud "General Purpose" SSD, you might see 3,000 IOPS if you are lucky. On CoolVDS KVM instances, where we pass through local NVMe storage directly to the VM, we routinely see 15,000+ IOPS without any extra "provisioning" fees.
Pro Tip: When configuring MySQL on high-speed NVMe, ensure yourinnodb_io_capacityin/etc/my.cnfis set high enough to utilize the disk. The default is too low for modern hardware.
[mysqld]
# Default is often 200. On NVMe, crank this up.
innodb_io_capacity = 2000
innodb_io_capacity_max = 4000
innodb_flush_neighbors = 0 # SSDs don't need neighbor flushing
3. Egress Traffic and The Norwegian Advantage
Data ingress (uploading to the cloud) is usually free. Data egress (users downloading your content) is expensive. If you are hosting media-rich content or serving an API with heavy JSON payloads, bandwidth bills can exceed compute costs.
This is strictly a geography game. If your customers are in Norway or Northern Europe, hosting in a US-East or even a Frankfurt datacenter introduces latency and transit costs.
Latency Matters:
Ping from Oslo to Frankfurt: ~25-30ms.
Ping from Oslo to Oslo (CoolVDS via NIX): ~1-3ms.
Google has been pushing page speed as a ranking factor. A 30ms delay on the TCP handshake adds up over dozens of requests. By peering directly at the Norwegian Internet Exchange (NIX), we bypass international transit providers. You get lower latency and we don't have to charge the exorbitant egress fees that AWS does.
4. Preparing for the GDPR Storm
We are just over a year away from May 2018. The General Data Protection Regulation is coming. If you are a CTO, the "Schrems" ruling should already be on your radar. Relying on "Privacy Shield" for US data transfers is becoming legally risky.
Datatilsynet (The Norwegian Data Protection Authority) is clear about data sovereignty. Hosting sensitive customer data on servers physically located in Norway (within the EEA) simplifies your compliance architecture massively.
Cost optimization isn't just about the monthly invoice; it's about avoiding legal fines. Migrating data after a compliance breach is the most expensive project you will ever undertake. Build it right now. Keep the data local.
5. Right-Sizing the Stack: Nginx Caching
Hardware is only half the equation. You can cut your CPU requirements in half by configuring your software correctly. Too many sysadmins throw more vCPUs at a slow site instead of tuning the web server.
If you aren't using FastCGI caching in Nginx, you are wasting CPU cycles generating the same PHP pages over and over.
Here is a production-ready snippet for nginx.conf to cache dynamic content (like WordPress) for 60 minutes. This allows a small 2-core VPS to handle traffic that would usually crush an 8-core server.
http {
...
# Define the cache path
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
server {
...
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
# Enable Caching
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 60m;
fastcgi_cache_use_stale error timeout invalid_header http_500;
}
}
}
The Verdict: Predictability Wins
The public cloud is fantastic for sporadic, bursty workloads. But for the core 80% of your infrastructure—database servers, application backends, and corporate tools—the premium you pay for "elasticity" is wasted capital.
At CoolVDS, we believe in raw performance and transparent pricing. We use KVM virtualization to ensure you get the RAM and CPU cycles you pay for—no noisy neighbors stealing your cycles. With local NVMe storage and direct peering in Oslo, you get enterprise-grade performance without the enterprise-grade price tag.
Don't let slow I/O kill your SEO or cloud bills kill your runway. Deploy a high-performance NVMe instance on CoolVDS today and see what sub-millisecond latency feels like.