AWS EC2 PHP(Ubuntu)需要10秒以上才能加载1页

site: cuddledog.com

This just started happening, it was running quick and smoothly before.

I've tried restarting the EC2 instance with no luck in speed.

Network load times on all PHP pages are 10+ seconds (up to over 2 minutes)

The PHP on that page is extremely simple

Example

Found out through apache2 logs that my IP was being flooded with advertisement as a proxy.

Got a new IP and everything seems to be working fine now.

I'll add troubleshooting steps for those who encounter this same issue.

See if you can access your server internally

# curl localhost:80

If you're receiving a long response time or a timeout, then look at your apache logs.

Ubuntu default location: # tail -f /var/log/apache2/error.log

What I was seeing is thousands of lines of entries trying to use my web server as a proxy for ads. After some research online, this happens mostly when you use an IP that was used before for this purpose. Re requesting a new IP from your ISP (AWS in this instance) will get you back up and running.

If not then start troubleshooting external access # curl domain.com or # curl x.x.x.x