Jump to content


Photo

MySQL CPU Problems


  • Please log in to reply
3 replies to this topic

#1 Doyley

Doyley
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 04 July 2005 - 03:31 PM

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


#2 mreish

mreish
  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts

Posted 31 July 2005 - 12:37 PM

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!
Mike

#3 ecstasy

ecstasy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 01 August 2005 - 07:49 AM

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

View Post


Use only
mysql_connect()

And try to use Linux pall! ;)


#4 ecstasy

ecstasy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 01 August 2005 - 12:46 PM

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

View Post


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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users