Re: mysql_connect slowness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Waynn!

have you ever tried using

1. sql_cache
SELECT SQL_CACHE * FROM table ......

I use this alot... although you have to have mysql cache enable in the
sql config file... your webhost can tell you if it is on or not

2. make indexes for your tables

here is a good article
http://www.databasejournal.com/features/mysql/article.php/1382791
a great admin program to use is Navicat... it's very easy to make your
indexes there...


Hopefully those 2 suggestions speed up things a little! :o) let us
know if it works

Joe

On Mon, Apr 28, 2008 at 12:14 AM, Waynn Lue <waynnlue@xxxxxxxxx> wrote:
> Our site has been slowing down dramatically in the last few days, so
>  I've been trying to figure out why.  I ran some profiling scripts on
>  our site and saw that we're spending between 3-9 seconds on
>  mysql_connect.  Then I connected to our db and saw that there were
>  over 100 connections at the time, most of them sleeping.  Is this
>  because we don't close mysql connections until the end of script
>  execution?
>
>  How do people generally structure their code to minimize the time they
>  keep mysql connections open?  Currently all db connections go through
>  one file, which gets included at the top of the file.  One other
>  question, is it better to open one connection, then re-use it later,
>  or just continually open and close per db call?
>
>  Thanks,
>  Waynn
>
>  --
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux