May 16, 2024

I work with a client who operates a high-traffic Woocommerce website. Their current setup involves utilizing a SQL-based database system, and recently, there have been instances of noticeable performance slowdowns.

After extensive troubleshooting, it became evident that the performance bottleneck was occurring at the database server level. The client had been utilizing Cloud SQL to host their database for their expansive WordPress website.

While there is no official documentation specifying the machine family employed by Cloud SQL, research indicates that it relies on the N1 machine type, which is known for its relatively subpar CPU performance.

Therefore, I recommended that they transition away from Cloud SQL and instead opt for a Google Compute Engine (GCE) virtual machine (VM) hosting MariaDB, utilizing the C2D machine type.

The C2D machine type belongs to the compute-optimized machine family and is known to provide approximately 50% to 100% faster overall performance compared to the N1 machine type.

I conducted several performance tests, and here are the results:

– n1-standard-1 = 11.8 seconds
– c2-standard-4 = 6.8 seconds
– n1-standard-1 = 9.6 seconds (after a restart)
– n1-standard-8 = 9.2 seconds
– n2-standard-2 = 8 seconds
– e2-standard-2 = 6.4 seconds
– c2d-standard-2 = 5.5 seconds

All tests were performed on the same database server and the same WordPress page (a page listing all posts, which imposes a significant load on the database). I conducted each test five times and calculated the average time for each refresh.

As the results clearly demonstrate, the N1 machine type offers inferior performance. Notably, the C2 and C2D machine types exhibit significantly improved performance. Surprisingly, the E2 machine type also performed quite well, even surpassing the N2 machine types. It’s worth noting that E2 is recommended over N2 due to its favorable price-performance ratio.

Leave a Reply

Your email address will not be published. Required fields are marked *