Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Elxis 5.5 Calypso supports 2 factor authentication login with e-mail or SMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Database
»
Mysql too many connections
« previous
next »
Print
Pages: [
1
]
Author
Topic: Mysql too many connections (Read 10880 times)
yiannisK
Elxis Community
Sr. Member
Posts: 302
Mysql too many connections
«
on:
October 10, 2010, 17:21:25 »
Hello friends after longgg time!
Last days, there are too many connections on mysql service. Till now, always working with:
Code:
[Select]
[mysqld]
set-variable=max_connections=150
set-variable=max_user_connections=0
(settings
my.cnf
file)
I run the "processlist" command in mysqladmin section (SSH mode) to see what is going on.
I noticed that some elxis based sites, has, without any particular reason (low number of guests), too many active sql connections!
My question is: how can i drop (switch off) older, past sql connections that are remaining active. Elxis, has a mechanism after a guest leaves the website, to drop the sql connection or this is a server-side setting?
Details:
The site has defender, floodblocker enabled.
mysql 5.0.77 (Version: 5.0.77)
PHP Version: 5.1.6
Web Server: Apache/2.2.3 (CentOS)
Version Elxis 2009.0 Stable rev2437 [ Pandora ] 22-May-2009 10:31 GMT+2
«
Last Edit: October 10, 2010, 17:24:24 by yiannisK
»
Logged
CREATIVE Options
Authorized Elxis Professional
Elxis Community
Hero Member
Posts: 2334
Professional services for Elxis CMS
Re: Mysql too many connections
«
Reply #1 on:
October 10, 2010, 17:23:31 »
1st you have to check, 3rd parties components, modules, bot.
2nd check the log's
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Mysql too many connections
«
Reply #2 on:
October 10, 2010, 22:19:15 »
Open
includes/Core/database.php
file and change this:
....$this->_resource->
PConnect
(....)
to this:
....$this->_resource->
Connect
(....)
You will find this in 2 places at the top of the file inside function __construct.
Note:
you dont need to do that if you use Elxis 2009.2.
Older Elxis versions used persistent database connections. This means that the db connection does not closes after the load of the page in order to have fast response on the next request. This is better for sites with high traffic but not for low-mid traffic. We stopped persistent connections on newer releases. Do this change to stop persistent connections.
To remove past connections restart mysql:
/etc/init.d/mysql restart
(or wherever your mysql daemon is located to)
«
Last Edit: October 10, 2010, 22:23:04 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
yiannisK
Elxis Community
Sr. Member
Posts: 302
Re: Mysql too many connections
«
Reply #3 on:
October 10, 2010, 23:05:06 »
Thanks Datahell! That's exactly i was looking for...
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Database
»
Mysql too many connections