Performance Optimization on AWS Lightsail: A Case Study

Performance Optimization on AWS Lightsail - Overview

Performance-Optimization-on-AWS Lightsail_before_after

In this case study you will find out how HYPESTUDIO helps businesses with Performance Optimization on AWS Lightsail. This case study examines an incident where a WordPress site hosted on Amazon Lightsail experienced severe performance issues due to misconfiguration and ongoing attacks. The owner initially tried upgrading to larger Lightsail instances to resolve the problems, but CPU usage continued spiking above 80% even with low visitor traffic. By implementing best practices for WordPress configuration along with firewall rules and resource optimizations in Lightsail, the site performance improved tremendously while also allowing for a downgrade to smaller, less expensive Lightsail instance.

The Key Issues

The WordPress site mentioned here is a site dedicated to hosting information for cars & coffee events. The site owner had recently migrated hosting to Amazon Lightsail, choosing their largest available instance. However, despite averaging only 100 visitors per 30 minutes, database usage was inconsistent - often spiking server CPU usage up to 80%.

Troubleshooting identified the root causes as:

  • Poor WordPress configuration with too many unnecessary plugins installed (61 active). Many were outdated or posed security risks.
  • The site was facing ongoing malicious attacks from specific IP addresses. One key attacker was based in Amsterdam.
  • Issues with the database not properly indexing a plugin's tables, leading to resource contention.

Without addressing these core configuration and software issues, simply throwing more infrastructure capacity wasn't effective. Optimizing the application itself would be required.

Key Optimizations Performed

The solution focused on implementing WordPress best practices, adding firewall protection, and optimizing database performance. Specific steps included:

WordPress Configuration:

  • Updated outdated plugins, removed unnecessary plugins (reduced from 61 to 56)
  • Added object caching to reduce database hits
  • Addressed plugin performance issues related to events calendar plugin

Firewall:

  • Blocked attacking IP addresses through host firewall rules
  • Also blocked entire subnet ranges when attacks persisted

Database:

  • Resolved index issue causing table locks and slow queries
  • Tuned additional database parameters

AWS Lightsail:

  • Monitored infrastructure metrics to validate utilization

The Outcome

The optimizations allowed the WordPress site to utilize AWS Lightsail resources much more efficiently despite ongoing attacks. As a result, the expensive $160/month Lightsail instance could be downsized to an $80/month option without performance concerns. The site owner noted CPU usage now ranging from 5-15% on average compared to spiking over 80% previously.

By addressing the root cause configuration issues and scaling the software optimally, the solution saved on web hosting fees while delivering a smoother, faster user experience. The site owner was extremely pleased with the dramatic turnaround and improved performance for a modest one-time optimization cost.

Performance Optimization on AWS Lightsail

Key Takeaways

There are some key lessons that can be learned from this performance optimization on AWS Lightsail case study:

  1. Adding more infrastructure capacity isn't always the best answer - first optimize the software and application.
  2. WordPress can require significant tuning and modification especially when there are multiple plugins installed. Periodic cleanup is wise.
  3. Don't underestimate security factors - attacks and bots can silently consume resources. Firewalls and request throttling may help.
  4. Measure real world user-based performance rather than infrastructure-only metrics.
  5. Collaboration between developers and infrastructure teams is extremely beneficial for holistic improvements.

It's important to note that successfully optimizing a complex WordPress implementation requires an experienced and knowledgeable service provider. The breadth of skills needed across WordPress, database tuning, infrastructure monitoring, and security configurations means only a technically advanced team has the capabilities to thoroughly assess and resolve all potential issues.

By taking an application-centric view, this project resolved the scaling and optimization challenges through improved WordPress configuration and Lightsail performance best practices rather than just throwing larger servers at the problems. The solution delivered better site quality for end users and lower resource costs for the owner - a win/win outcome.

Have a Project in Mind?

Got a Vision? Let’s Turn it into Reality – Your Project, Our Expertise