It is 2012. Your Database Should Not Be the Bottleneck.
I see it every week. A client migrates a perfectly good Magento or Drupal installation to a new server, and suddenly, the load average spikes to 20. The CPU isn't doing math; it's waiting. It is screaming in iowait.
In the high-stakes world of e-commerce, a 500ms delay is the difference between a sale and a bounce. If you are hosting customers in Norway or Northern Europe, you cannot afford to have your MySQL process blocked by spinning rust platters or a default my.cnf file that assumes you are running on 512MB of RAM.
Let's fix this. We are going to look at the specific MySQL 5.5 configurations and architecture choices that separate professional deployments from the rest.
1. The Hardware Reality: Spindles are Dead
Before we touch a single config file, we must address the physical layer. If your VPS provider is putting your database on a shared 7.2k RPM SATA drive, no amount of tuning will save you. Database performance is fundamentally bound by IOPS (Input/Output Operations Per Second).
At CoolVDS, we have moved aggressively to Pure SSD (Solid State Drive) arrays. The difference is not subtle.
| Storage Type | Random Read IOPS | Latency |
|---|---|---|
| 7.2k SATA HDD | ~80-100 | ~12-15ms |
| 15k SAS HDD | ~180-200 | ~5-7ms |
| CoolVDS Enterprise SSD | ~50,000+ | < 0.1ms |
When you run a complex JOIN query that hits disk, SSDs return the data instantly. HDDs queue the request. If you are serious about performance, ensure your hosting provider offers genuine SSD storage, not just SSD-caching.
2. The Holy Grail: innodb_buffer_pool_size
With MySQL 5.5, InnoDB is the default engine, replacing the archaic MyISAM. InnoDB loves RAM. The single most critical setting in your configuration is innodb_buffer_pool_size.
This setting determines how much data and indexes MySQL caches in memory. If your active dataset fits in the buffer pool, you avoid disk I/O entirely for reads.
The Golden Rule: Set this to 70-80% of your total available RAM on a dedicated database server.
[mysqld]
# For a VPS with 4GB RAM
innodb_buffer_pool_size = 3G
# Ensure you have innodb_file_per_table enabled in 5.5
innodb_file_per_table = 1
Pro Tip: Do not set this so high that you starve the OS. If Linux swaps, your database dies. Leave at least 1GB for the OS and other processes. Use free -m to check your headroom.
3. The Durability vs. Speed Trade-off
By default, MySQL is paranoid. It flushes data to the redo log on disk after every single transaction commit. This is safe, but slow.
If you can tolerate losing 1 second of data in the event of a catastrophic power failure (and you have a battery-backed RAID controller or a reliable host like CoolVDS), you can change innodb_flush_log_at_trx_commit.
# Default is 1 (Safest, Slowest)
# Set to 2 for 10x-50x write improvement
innodb_flush_log_at_trx_commit = 2
With this set to 2, logs are written to the OS cache at commit and flushed to disk once per second. For high-volume insert applications, this removes the disk sync bottleneck almost entirely.
4. Diagnosing the Bottleneck
Stop guessing. Use the tools Linux gives you. If your site is slow, log into your shell and run iostat (part of the sysstat package).
$ iostat -x 1
avg-cpu: %user %nice %system %iowait %steal %idle
10.5 0.0 2.1 45.0 0.0 42.4
Device: rrqm/s wrqm/s r/s w/s svctm %util
sda 0.00 24.00 55.00 80.00 8.50 98.50
Look at %iowait. If it is high (over 10-20%), your disk cannot keep up. Look at %util. If it is near 100%, your drive is saturated. This is common on oversold VPS hosts where noisy neighbors steal your I/O.
This is why CoolVDS uses KVM virtualization. Unlike OpenVZ, KVM provides stricter isolation. Your RAM is allocated, and your I/O is protected. We don't believe in overselling resources because we know what happens when a neighbor launches a backup script during your peak hours.
5. Local Law and Latency
Performance isn't just about disk speed; it's about network physics. If your target audience is in Oslo, Bergen, or Trondheim, hosting your database in a US datacenter adds 100ms+ of latency to every round trip.
Hosting in Norway, specifically connected to the NIX (Norwegian Internet Exchange), drops that latency to single digits. For a PHP application making 20 sequential database queries per page load, that is a difference of 2 seconds vs 20 milliseconds.
The Compliance Angle
We must also address the legal landscape. The Norwegian Personal Data Act (Personopplysningsloven) and the EU Data Protection Directive (95/46/EC) place strict requirements on how personal data is handled. Storing customer data within Norwegian borders satisfies the Datatilsynet requirements and builds trust with your users. They know their data isn't subject to foreign subpoenas.
Summary: The Checklist
To ensure your MySQL 5.5 instance flies on CoolVDS:
- Migrate tables to InnoDB.
- Tune
innodb_buffer_pool_sizeto 70% of RAM. - Consider
innodb_flush_log_at_trx_commit = 2if absolute durability isn't critical. - Host on SSD storage to eliminate I/O seek latency.
- Keep the server physically close to your users (Norway/Europe).
Don't let legacy hardware or default configs kill your growth. Spinning disks belong in museums, not production servers.
Ready to see the difference? Deploy a high-performance SSD VPS instance on CoolVDS today and drop your wait times to zero.