Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL
Author Message
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Tue Feb 06, 2007 10:56 am Reply with quote

When I complain of speed, my host thinks I need more information on closing db connections.

I've googled and read otherwise. And, I just did a search of my latest RN and didn't find any instance of mysql_close.

If I didn't find it in RN, is it required in my stand alone scripts?


I'm confuddled, again.
I know there is a mysql config in php.ini that might improve performace, but I don't know what I'm doing because I don't understand what it is I should be doing.
And, of course, the hosts suggested a fix might only require buying more memory.

Opinions and clues? Logs I should be scanning?

Have a happy nuking day.

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Feb 06, 2007 2:05 pm Reply with quote

mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier.
Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.

so what the question realy is in this isnt that clear...
naturaly no host is gonna confess that speed is bad or whatever...
btw...a standard configuration is sufficiant enough...

Quote:
fix might only require buying more memory


nice story...
 
View user's profile Send private message
djmaze
Subject Matter Expert



Joined: May 15, 2004
Posts: 727
Location: http://tinyurl.com/5z8dmv

PostPosted: Tue Feb 06, 2007 4:39 pm Reply with quote

speed: cause by non-optimized queries.

To test it, echo or log all database queries (echoing is better, that way you see how much queries get executed)

Then place the word EXPLAIN in front of each SELECT query and run them one at the time in your favorite sql manager.

You will notice the massive amount of indexes missing.

_________________
$ mount /dev/spoon /eat/fun auto,overclock 0 1
ERROR: there is no spoon [ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Feb 11, 2007 9:40 am Reply with quote

mysql_close is almost always NOT needed. It actually slows down your scripts. So, your host need to be educated Smile
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©