İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

MySQL CPU Kullanımı my.cnf optimizasyonu

Remark

0
İyinet Üyesi
Katılım
24 Mayıs 2007
Mesajlar
395
Reaction score
0
) ENGINE=MyISAM şeklinde yukarıda verdiğiniz my.cnf uyguladım fakat bu seferde pleske giremiyorum
 

Remark

0
İyinet Üyesi
Katılım
24 Mayıs 2007
Mesajlar
395
Reaction score
0
skip-locking
skip-innodb

bu iki satırı sildim plesk çalışmaya başladı. Yanlış birşey yapmamışımdır umarım.
 

HostAnadolu

0
İyinet Üyesi
Katılım
23 Ekim 2007
Mesajlar
22
Reaction score
0
E 6550
2Gb ram var sunucumda. my-huge.cnf kullandım.
top -n1 :
Mem: 2066928k total, 2006800k used, 60128k free, 13300k buffers
Swap: 2031608k total, 1002292k used, 1029316k free, 214480k cached

My-huge.cnf i kullanmadan önce %60larda seyreden ram seviyesi , kullandıktan sonra %80in altına inmedi. Ayrıca swap ta yüksek.
Sunucum için my.cnf değerleri ne olmalı
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
63
Konum
Sakarya
E 6550
2Gb ram var sunucumda. my-huge.cnf kullandım.
top -n1 :
Mem: 2066928k total, 2006800k used, 60128k free, 13300k buffers
Swap: 2031608k total, 1002292k used, 1029316k free, 214480k cached

My-huge.cnf i kullanmadan önce %60larda seyreden ram seviyesi , kullandıktan sonra %80in altına inmedi. Ayrıca swap ta yüksek.
Sunucum için my.cnf değerleri ne olmalı

my-huge.cnf 16Gb RAM içındir oysa sizin sadece 2Gb nız var.
my.cnf inizi buraya eklerseniz yardımcı olmaya çalışırız.
 

HostAnadolu

0
İyinet Üyesi
Katılım
23 Ekim 2007
Mesajlar
22
Reaction score
0
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 16M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using BDB tables
#bdb_cache_size = 384M
#bdb_max_lock = 100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
 

aspmeraklisi

0
İyinet Üyesi
Katılım
10 Nisan 2005
Mesajlar
76
Reaction score
0
banada yardim lütfen

Merhaba benimde mysql cpu kullanimi cok oluyor. Cpu yerine rame yüklensek daha iyi olur ramim ep eyi bosta , asagida hali hazrda kullandigim confg var düzenlemede yardimci olursaniz sevinirim .

Makina 2GB DDR - AMD OPTERON 144 INNODB KULLANILIYOR

[MySQLD]
port=3306
basedir=D:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL
datadir=D:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL\\Data
default-character-set=latin1
default-storage-engine=INNODB
query_cache_type=1
query_cache_size=32M
max_allowed_packet=64M
wait_timeout=3600
read_buffer_size=1M
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=16M
innodb_log_file_size=10M
innodb_thread_concurrency=8
max_connections=100
old_passwords=1
max_user_connections=30
thread_cache_size=4
thread_stack=196608
binlog_cache_size=32768
net_read_timeout=30
net_retry_count=10
net_write_timeout=30
thread_concurrency=10
open_files_limit=0
table_cache = 512
key_buffer = 384M
skip-locking
[client]
port=3306
 

sverdlow

0
İyinet Üyesi
Katılım
17 Kasım 2005
Mesajlar
2,778
Reaction score
0
Konum
Ankara/Kayseri
merhaba iyinet,
tavsiyene ihtiyacım var; makinada load ve ram kullanımı gayet normal ama mysql kasılıyor, cevap süresi çok uzuyor, çoğu zaman hiç cevap vermiyor.
sunucu 4gb + 4 x (3 ghz xeon cpu)
top çıktısı;
top - 19:46:28 up 2 days, 6:06, 1 user, load average: 0.84, 0.93, 0.83
Tasks: 264 total, 2 running, 261 sleeping, 0 stopped, 1 zombie
Cpu(s): 7.6% us, 2.0% sy, 0.0% ni, 87.2% id, 3.0% wa, 0.1% hi, 0.0% si
Mem: 4148496k total, 3701504k used, 446992k free, 151084k buffers
Swap: 2040244k total, 62740k used, 1977504k free, 2477484k cached

mysql config;
[mysqld]
safe-show-database
skip-locking
skip-innodb
skip-name-resolve
max_connections = 500
key_buffer = 1538M
table_cache = 1800
thread_cache_size = 384
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
query_cache_size = 64M
query_cache_type = 1
default-storage-engine = MyISAM


[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
 

sverdlow

0
İyinet Üyesi
Katılım
17 Kasım 2005
Mesajlar
2,778
Reaction score
0
Konum
Ankara/Kayseri
üstteki mesajımı düzenleyemedim,
centos, php5.24, mysql 5 kullanıyorum.
yardımınızı bekliyorum.
teşekkürler.
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
63
Konum
Sakarya
sverdlow, ayarlar iyi gorunuyor, veritabaninda optimizasyon gerekebilir.
Kullandigin yazilim nedir, indexler tammidir, tablolar optimizemidir. Yazilim SQL i iyi kullanmismidir?
 

aspmeraklisi

0
İyinet Üyesi
Katılım
10 Nisan 2005
Mesajlar
76
Reaction score
0
iyinet banada yardim lütfen

iyinet beni görmedin sanirim . bunada bi el atarsan sevinirim .

Merhaba benimde mysql cpu kullanimi cok oluyor. Cpu yerine rame yüklensek daha iyi olur ramim ep eyi bosta , asagida hali hazrda kullandigim confg var düzenlemede yardimci olursaniz sevinirim .

Makina 2GB DDR - AMD OPTERON 144 INNODB KULLANILIYOR

[MySQLD]
port=3306
basedir=D:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL
datadir=D:\\Program Files\\SWsoft\\Plesk\\Databases\\MySQL\\Data
default-character-set=latin1
default-storage-engine=INNODB
query_cache_type=1
query_cache_size=32M
max_allowed_packet=64M
wait_timeout=3600
read_buffer_size=1M
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=16M
innodb_log_file_size=10M
innodb_thread_concurrency=8
max_connections=100
old_passwords=1
max_user_connections=30
thread_cache_size=4
thread_stack=196608
binlog_cache_size=32768
net_read_timeout=30
net_retry_count=10
net_write_timeout=30
thread_concurrency=10
open_files_limit=0
table_cache = 512
key_buffer = 384M
skip-locking
[client]
port=3306
 

atay

0
İyinet Üyesi
Katılım
29 Ekim 2005
Mesajlar
3,592
Reaction score
37
makine özellikleri:

AMD 64 4200 DualCore
2GB RAM
CentOS 5 32 Bit
Plesk 8.2

my.cnf geldiği gibi duruyor, daha doğrusu makine yeni geldi :) alışkanlığımdan şaşmayıp her makinede olduğu gibi yine iyinet'in my.cnf önerisini almak istedim. teşekkürler...

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
63
Konum
Sakarya
makine özellikleri:

AMD 64 4200 DualCore
2GB RAM
CentOS 5 32 Bit
Plesk 8.2

my.cnf geldiği gibi duruyor, daha doğrusu makine yeni geldi :) alışkanlığımdan şaşmayıp her makinede olduğu gibi yine iyinet'in my.cnf önerisini almak istedim. teşekkürler...

Su ankinin yedegini alip my.cnf i asagidaki sekilde degistir.
3-4 gun sonra http://forum.iyinet.com/mysql-veritabani-sql/77047-tuning-primer-sh-mysql-tuning-scripti.html buradaki scripti calistir ve ciktiyi buraya ekle, sonayarlari yapalim.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

skip-locking
skip-innodb
skip-name-resolve
key_buffer = 256M
max_connections = 300
table_cache = 50000
thread_cache_size = 384
join_buffer_size = 2M
low_priority_updates = 1
query_cache_size = 40M
query_cache_type = 1
query_cache_limit = 4M

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 

atay

0
İyinet Üyesi
Katılım
29 Ekim 2005
Mesajlar
3,592
Reaction score
37
teşekkür ederim. yarın öğlene doğru siteler taşınmış olacak, dediğiniz gibi makine işler duruma geçtikten sonra yeniden yazarım gidişatı ve bahsettiğiniz yazılımın önerilerini.

bu arada, plesk panelli serverlarda skip-innodb eklenince panel açılmıyor. verdiğiniz confdan skip-innodb yi çıkartmak zorunda kaldım.
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
63
Konum
Sakarya
teşekkür ederim. yarın öğlene doğru siteler taşınmış olacak, dediğiniz gibi makine işler duruma geçtikten sonra yeniden yazarım gidişatı ve bahsettiğiniz yazılımın önerilerini.

bu arada, plesk panelli serverlarda skip-innodb eklenince panel açılmıyor. verdiğiniz confdan skip-innodb yi çıkartmak zorunda kaldım.

Demekki plesk innodb kullaniyor.
show status like "%innodb%";
komutunun mysql de ciktisini buraya yazarmisin bir zahmet.
 

atay

0
İyinet Üyesi
Katılım
29 Ekim 2005
Mesajlar
3,592
Reaction score
37
mysql root şifresini henüz oluşturmadığım halde mysql yazdığımda şifre soruyor. henüz sorunu anlayamadım dolayısıyla komutuda çalıştıramıyorum
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst