addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [php-49] sql too many connections

From: Mark S.
Sent on: Thursday, November 8, 2012, 12:05 PM
Hmmm that's a good thing to look at.


On Thu, Nov 8, 2012 at 12:04 PM, Dan Munro <[address removed]> wrote:
I think it depends on the type of include. include(), and require(), will open new connections each time afaik. include_once()/require_once() wouldn't.


On Thu, Nov 8, 2012 at 12:02 PM, Mark Steudel <[address removed]> wrote:
If PHP is just using the default mysql_connect in a single include file which is required throughout the site, doesn't it by default attempt to use the same open connection?


On Thu, Nov 8, 2012 at 11:57 AM, Dan Munro <[address removed]> wrote:
Do you know how connections are handled while the script/s run? One thing that I've seen before is that each area of code (as in each include, procedural script, or class) will open it's own new connection to the db, instead of reusing an existing connection, which should reduce the number of open connections.


On Thu, Nov 8, 2012 at 11:48 AM, Mark Steudel <[address removed]> wrote:
So I've inherited a site that has a lot of traffic and we're getting
too many sql connectionsin the error logs. Obviously one solution is
to up the # of max connections in the my.cnf (right now its at 150, I
upped it to 200). I wanted to explore the code and see if there were
some things from the php side I could do to eliminate some of the
problems. Any suggestions on things to try or look for? I can't decide
if using mysql_close explicitly on pages is a good idea or not. Any
guidelines?

--
-----------------------------------------
Mark Steudel
P: [masked]
F: [masked]
[address removed]

. : Work : .
http://www.mindfulinteractive.com

. : Play : .
http://www.steudel.org/blog

. : LinkedIn : .
http://www.linkedin.com/in/steudel



--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/php-49/
This message was sent by Mark Steudel ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Mark Steudel, visit his/her member profile: http://www.meetup.com/php-49/members/2764664/
Set my mailing list to email me

As they are sent
http://www.meetup.com/php-49/list_prefs/?pref=1

In one daily email
http://www.meetup.com/php-49/list_prefs/?pref=2

Don't send me mailing list messages
http://www.meetup.com/php-49/list_prefs/?pref=0
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]




--
From the desk of Dan Munro




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Dan Munro ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Dan Munro, visit his/her member profile



--
-----------------------------------------
Mark Steudel
P: [masked]
F: [masked]
[address removed]

. : Work : .
http://www.mindfulinteractive.com
 
. : Play : .
http://www.steudel.org/blog

. : LinkedIn : .
http://www.linkedin.com/in/steudel





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Mark Steudel ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Mark Steudel, visit his/her member profile



--
From the desk of Dan Munro




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Dan Munro ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Dan Munro, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]



--
-----------------------------------------
Mark Steudel
P:[masked]
F:[masked]
[address removed]

. : Work : .
http://www.mindfulinteractive.com
 
. : Play : .
http://www.steudel.org/blog

. : LinkedIn : .
http://www.linkedin.com/in/steudel

People in this
group are also in: