Forum Moderators: phranque

Message Too Old, No Replies

Rewrite Rules & MySQL

Can an "ugly" htaccess file cause too many mysql connections?

         

MsCarpetbagger

6:17 pm on May 7, 2007 (gmt 0)

10+ Year Member



I've been having a lot of server trouble with my site lately, and my host told me that today is the result of mySQL being overloaded with too many connections. Could the source of that be the .htaccess file?

I have WordPress managing the .htaccess file, but I think there's some old stuff in there that may be "confusing" to the server. When we migrated from Movable Type to WordPress, someone wrote the .htaccess file to convert the WP URL to mimic the old MT URL. That was over a year ago, and we've since upgrade WP where it'll do that for you now. So I'm thinking there's duplicate rewrite code in there.

Do you think this can cause server/db problems? I would think so, but need some expert advice!

jd01

9:39 am on May 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It shouldn't.

Your .htaccess file controls the file server (Apache), *not* the MySQL server (MySQL).

The connections come from the software you are running (WordPress, php) not the .htaccess.

I don't know the WordPress source well enough to know, but you might check to see if they are using mysql_pconnect(), which is a persistent connection, rather than mysql_connect().

That's about the best I can do.
You might try the PHP Forum [webmasterworld.com], or the Database Forum [webmasterworld.com].

Good luck.
Justin

coopster

5:50 pm on May 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A persistent connection [webmasterworld.com] won't do as there simply is no continuous connection from the customer's web browser to a server.

Also, if you are on a shared server then the Too many connections [dev.mysql.com] error may not be your fault. A quick search [google.com] over WebmasterWorld will turn up plenty of discussion on the topic.