By sknzl
I’m running a droplet with apache and wordpress installed on it. Basic load testing with the ab tool shows that the requests per second are much lower when the naked domain is used. For example:
ab -kc 10 -n 100 https://example.com/
results in an average connection time of >2000ms and
ab -kc 10 -n 100 https://www.example.com/
would result in an average connection time of ~700ms. Also htop shows that the cpu is at 100% for the test with the naked domain and for the www. domain the cpu stays relatively low all the time.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The error log shows unfortunately nothing and the .htaccess only contains the standard wordpress entry. However I have a suspicion that the problem is related to the WP Super Cache plugin. The small droplet runs a relatively heavy wordpress site. For some reason the cached static content is not loaded when the naked domain is accessed, instead the dynamic PHP content is called for every request. For now the problem is solved with following .htaccess rule:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
What’s your .htaccess look like? Is it perhaps redirecting in a loop until it hits the threshold and gives up? The apache error log will likely have some warning on this. I’d start there first.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.