[Resolved] .htaccess rewrite rule - slow down website

Status
Not open for further replies.
#1
Hi,

I'm facing a strange issue where the .htaccess rewrite rule that removes index.php, is slowing down website, ONLY when number of visitors is high. The same .htaccess rewrite rule was working without any slowdown problems for more than a year. Now, when visitors number is high, the website takes far longer to load (X5). When I remove the rewrite rule from .htaccess, loading time goes back to normal. The .htaccess I use is:

Code:
Options +FollowSymlinks
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
RewriteCond $1 !\.(css|js|gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
Any idea please?

Thanks in advance
 

NiteWave

Administrator
#2
the rewrite rules looks fine.
When I remove the rewrite rule from .htaccess, loading time goes back to normal
questions:
1. during high traffic time ?
2. the website still working after remove these rules ?

anyway, you can also try following rules while there seems no difference in theory.
Code:
RewriteEngine On
RewriteBase /
RewriteCond $1 !\.(css|js|gif|jpe?g|png|woff)$ [NC]
RewriteCond $1 !^index\.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
 
#3
questions:
1. during high traffic time ?
2. the website still working after remove these rules ?
Hi NiteWave,

Thank you for your reply, especially on a Sunday! To answer to your questions:

1. Yes, problem occurs only during high traffic time
2. The website is not working after remove these rules, but works the backend, that how I can test results.

I have tried the new htaccess entry you gave me but it didn’t change the situation.

Thanks,

Stratos
 

NiteWave

Administrator
#4
the logic regarding "the culprit is .htaccess" doesn't look correct or enough.

during the high traffic, you remove the rewrite rules, then the website stops working, the load goes back
--- that's because no one will access a not-working website, so the traffic go down rapidly and load drops too.

I see the problem is "when traffic is high, website becomes slow down".
it's no problem we help you to find out the root cause.

a screen shot of real-time stats at traffic peak can be very helpful at most time. can you capture one and/or provide other information.
 
#5
the logic regarding "the culprit is .htaccess" doesn't look correct or enough.

during the high traffic, you remove the rewrite rules, then the website stops working, the load goes back
--- that's because no one will access a not-working website, so the traffic go down rapidly and load drops too.

I see the problem is "when traffic is high, website becomes slow down".
it's no problem we help you to find out the root cause.

a screen shot of real-time stats at traffic peak can be very helpful at most time. can you capture one and/or provide other information.
Yes, you are right on this but when I disable the rule, the frontpage which has the 60-70% of the traffic works, only the internal pages do not work. Anyway, as you said the logic regarding "the culprit is .htaccess" might be wrong. I attach a screen shot of real-time stats in case there is something I missed

Many thanks

htaccess_sw-prob.jpg
 
#7

NiteWave

Administrator
#8
update:
1. from Strats:"changed the Max CONN to 20, and even to 30 and noticed that there is nearly always some requests at WaitQ."

2. changed Max CONN to 50, the WaitQ disappear!
otherwise, have to plan following:
opcode cache
wordpress super cache
suExec ProcessGroup mode
optimize mysql
disable some wordpress plugin
etc

to resolve or improve the WaitQ issue.

one site only is bottle-neck.
 
Status
Not open for further replies.
Top