Doyley Posted July 4, 2005 Share Posted July 4, 2005 Hi all, We are having lots of trouble with MySQL on our server. MySQL uses all of the CPU causing to server to run really slow making it impossible to use any of the sites on our server. We are running Windows Server 2003, IIS 6, PHP 4.3.9, MySQL 4.0.23. Here is our my.ini file [mysqld] # set basedir to your installation path basedir=D:/mysql # set datadir to the location of your data directory datadir=D:/mysql/data skip-locking set-variable = max_connections=350 set-variable = key_buffer=16M set-variable = myisam_sort_buffer_size=64M set-variable = join_buffer=3M set-variable = record_buffer=3M set-variable = sort_buffer=3M set-variable = table_cache=1024 set-variable = thread_cache_size=128 set-variable = wait_timeout=3600 set-variable = connect_timeout=10 log-slow-queries = mysql_slow_query.log [WinMySQLAdmin] Server=D:/mysql/bin/mysqld.exe QueryInterval=10 [safe_mysqld] open-files-limit=8192 [myisamchk] set-variable = key_buffer=64M set-variable = sort_buffer=64M set-variable = read_buffer=16M set-variable = write_buffer=16M Any Ideas would be appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/2382-mysql-cpu-problems/ Share on other sites More sharing options...
mreish Posted July 31, 2005 Share Posted July 31, 2005 Try using mysql_connect() instead of mysql_pconnect() in your Connections subdirectory. I had this same problem and my host asked me to change it. No problems since. Here's what my connection file looks like: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_dbconnection = "localhost"; $database_dbconnection = "mydbconnection"; $username_dbconnection = "mydbuser"; $password_dbconnection = "mydbpassword"; $dbconnection = mysql_connect($hostname_dbconnection, $username_dbconnection, $password_dbconnection) or trigger_error(mysql_error(),E_USER_ERROR); ?> Hope this helps. Let me know if it does 'cause this is the first time I've been able to answer a question in here! Quote Link to comment https://forums.phpfreaks.com/topic/2382-mysql-cpu-problems/#findComment-8037 Share on other sites More sharing options...
ecstasy Posted August 1, 2005 Share Posted August 1, 2005 Hi all, We are having lots of trouble with MySQL on our server. MySQL uses all of the CPU causing to server to run really slow making it impossible to use any of the sites on our server. We are running Windows Server 2003, IIS 6, PHP 4.3.9, MySQL 4.0.23. Here is our my.ini file [mysqld] # set basedir to your installation path basedir=D:/mysql # set datadir to the location of your data directory datadir=D:/mysql/data skip-locking set-variable = max_connections=350 set-variable = key_buffer=16M set-variable = myisam_sort_buffer_size=64M set-variable = join_buffer=3M set-variable = record_buffer=3M set-variable = sort_buffer=3M set-variable = table_cache=1024 set-variable = thread_cache_size=128 set-variable = wait_timeout=3600 set-variable = connect_timeout=10 log-slow-queries = mysql_slow_query.log [WinMySQLAdmin] Server=D:/mysql/bin/mysqld.exe QueryInterval=10 [safe_mysqld] open-files-limit=8192 [myisamchk] set-variable = key_buffer=64M set-variable = sort_buffer=64M set-variable = read_buffer=16M set-variable = write_buffer=16M Any Ideas would be appreciated. Thanks 248957[/snapback] Use only mysql_connect() And try to use Linux pall! Quote Link to comment https://forums.phpfreaks.com/topic/2382-mysql-cpu-problems/#findComment-8043 Share on other sites More sharing options...
ecstasy Posted August 1, 2005 Share Posted August 1, 2005 Hi all, We are having lots of trouble with MySQL on our server. MySQL uses all of the CPU causing to server to run really slow making it impossible to use any of the sites on our server. We are running Windows Server 2003, IIS 6, PHP 4.3.9, MySQL 4.0.23. Here is our my.ini file [mysqld] # set basedir to your installation path basedir=D:/mysql # set datadir to the location of your data directory datadir=D:/mysql/data skip-locking set-variable = max_connections=350 set-variable = key_buffer=16M set-variable = myisam_sort_buffer_size=64M set-variable = join_buffer=3M set-variable = record_buffer=3M set-variable = sort_buffer=3M set-variable = table_cache=1024 set-variable = thread_cache_size=128 set-variable = wait_timeout=3600 set-variable = connect_timeout=10 log-slow-queries = mysql_slow_query.log [WinMySQLAdmin] Server=D:/mysql/bin/mysqld.exe QueryInterval=10 [safe_mysqld] open-files-limit=8192 [myisamchk] set-variable = key_buffer=64M set-variable = sort_buffer=64M set-variable = read_buffer=16M set-variable = write_buffer=16M Any Ideas would be appreciated. Thanks 248957[/snapback] I've read smth today, on PHP installation website: If you experience 100% CPU usage after some time, turn off the IIS setting Cache ISAPI Application PHP 5 Installation Web Quote Link to comment https://forums.phpfreaks.com/topic/2382-mysql-cpu-problems/#findComment-8046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.