Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-19-2005, 02:57 PM   #1
JenC
Confirmed User
 
Join Date: Jun 2002
Location: New England
Posts: 515
Anyone know how to cut off too many mySQL connections?

My server is getting bombarded with too many mySQL connections, how can I cut some of them off.
JenC is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2005, 04:26 PM   #2
n0de
Confirmed User
 
Join Date: Jan 2003
Location: Within my lucid dream world.
Posts: 250
modify /etc/my.cnf and reduce the value of 'max_connections'
n0de is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2005, 04:39 PM   #3
JenC
Confirmed User
 
Join Date: Jun 2002
Location: New England
Posts: 515
I restarted apache and that seemed to do the trick. Thanks for your response.
JenC is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2005, 05:45 PM   #4
Clarion
Confirmed User
 
Join Date: Jan 2005
Location: Ontario, OR
Posts: 148
That may do it only temporary. The main cause of your problem most likely is the script youre using is bottlenecking mysql, and eventually may come back. The best thing to do if this happens again would be to reevaluate your script and work out any effeciencies. The other option for a temporary fix is to up your max connections count, however this won't improve the situation. Let me know if we can help you out. Drop me a line on ICQ: 342-801-972
__________________
Structure Northwest :: the cure for the common code ::
AIM: Asatruel | Yahoo!: Asatruel | ICQ: 111-638-053
Clarion is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2005, 06:00 PM   #5
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,409
mysql_close($db); as the last line in your sql using php files. (assuming $db is the value assigned to the connection when you opened it).
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2005, 07:14 PM   #6
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by V_RocKs
mysql_close($db); as the last line in your sql using php files. (assuming $db is the value assigned to the connection when you opened it).
PHP auto-closes SQL connections after page execution unless persistent connections are requested. It wouldn't fix the problem: if PHP is fine, nothing's been accomplished... if PHP or apache is acting funny, then it just obscures the problem without fixing it. Indeed, if you mysql_close() a shared connection, you might blow other things up. You're better off letting the resource reclaimation happen automatically in this case.

This all assumes that PHP is being used. For all we know it's JDBC, DBD::Mysql or an ODBC connection from a windows box running apache...
__________________
~
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.