setting server data base mysql


Status
Not open for further replies.

lopikunik

Beginner 2.0
Tolong para bro yang master2x, bagi ilmunya untuk setting my.cnf di server data base mysql.
Asumsi dengan pengunjung website 50.000 user per hari.

spesifikasi server :
prosessor : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
memori : 32 GB
HDD : 600 GB SAS

terima kasih.
 

lopikunik

Beginner 2.0
Pernah pake mysqltuner ga banyak membantu bro, thanks tutornya saya coba dulu.

ini saya lampirkan setting saya sebelumnya, koreksi jika ada yang salah :

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
port = 3306
tmpdir = /tmp
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

skip-external-locking
skip-name-resolve

# * Fine Tunning
key_buffer = 50M
max_allowed_packet = 32M
thread_stack = 256K
thread_cache_size = 32
sort_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 8M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 500
max_connect_errors = 100
table_cache = 8012
thread_concurrency = 16
concurrent_insert = 2

tmp_table_size = 512M
max_heap_table_size = 512M

#
# * Query Cache Configuration
#
query_cache_limit = 128M
query_cache_size = 8M
query_cache_type = 2

#
# * Access Time
#
interactive_timeout = 40
wait_timeout = 15
connect_timeout = 30

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1

#log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 5
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 30
max_binlog_size = 200M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

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

terima kasih.

susah2 gampang jawabnya..
mungkin install dulu mysqltuner

ini ada sedikit info: my.cnf Optimization for Fun and Savings | On Forums
 

BennyKusman

Hosting Guru
Verified Provider
Pernah pake mysqltuner ga banyak membantu bro, thanks tutornya saya coba dulu.

ini saya lampirkan setting saya sebelumnya, koreksi jika ada yang salah :

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
port = 3306
tmpdir = /tmp
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

skip-external-locking
skip-name-resolve

# * Fine Tunning
key_buffer = 50M
max_allowed_packet = 32M
thread_stack = 256K
thread_cache_size = 32
sort_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 8M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 500
max_connect_errors = 100
table_cache = 8012
thread_concurrency = 16
concurrent_insert = 2

tmp_table_size = 512M
max_heap_table_size = 512M

#
# * Query Cache Configuration
#
query_cache_limit = 128M
query_cache_size = 8M
query_cache_type = 2

#
# * Access Time
#
interactive_timeout = 40
wait_timeout = 15
connect_timeout = 30

#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1

#log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 5
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 30
max_binlog_size = 200M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

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

terima kasih.

dengan memori 32GB, saya rasa value ini bisa dinaikan:
tmp_table_size = 512M
max_heap_table_size = 512M

#
# * Query Cache Configuration
#
query_cache_limit = 128M
query_cache_size = 8M

biasa saya rubah value, trus pake mysqltuner liat hasilnya.. ditunggu beberapa hari dan rubah lagi.. untuk exact value, susah jg diberikan.. mungkin untuk awal bisa dikali 2 dari original value
 

lopikunik

Beginner 2.0
dengan memori 32GB, saya rasa value ini bisa dinaikan:


biasa saya rubah value, trus pake mysqltuner liat hasilnya.. ditunggu beberapa hari dan rubah lagi.. untuk exact value, susah jg diberikan.. mungkin untuk awal bisa dikali 2 dari original value

Thanks ya mas bro, saya cobanya dulu.
 

twistedshells

Apprentice 1.0
Tolong para bro yang master2x, bagi ilmunya untuk setting my.cnf di server data base mysql.
Asumsi dengan pengunjung website 50.000 user per hari.

spesifikasi server :
prosessor : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
memori : 32 GB
HDD : 600 GB SAS

terima kasih.

Dengan spesifikasi diatas semestinya dengan nilai default tidak ada masalah untuk pengunjung 50.000/hari ~ 2100 user/jam ~ kurang dari 1 user/detik ;)

Memangnya sekarang yang dirasakan apa? lambatkah ? front end nya menggunakan apa ? web application ?
 

lopikunik

Beginner 2.0
Dengan spesifikasi diatas semestinya dengan nilai default tidak ada masalah untuk pengunjung 50.000/hari ~ 2100 user/jam ~ kurang dari 1 user/detik ;)

Memangnya sekarang yang dirasakan apa? lambatkah ? front end nya menggunakan apa ? web application ?

iya mas bro lambat, padahal di web servernya udah kubikin maksimal untuk MaxClients dan ServerLimit.
maksud dari front end nya menggunakan apa ? web application ? itu apa yah?
 

BennyKusman

Hosting Guru
Verified Provider
iya mas bro lambat, padahal di web servernya udah kubikin maksimal untuk MaxClients dan ServerLimit.
maksud dari front end nya menggunakan apa ? web application ? itu apa yah?

apa lambatnya gara2 mysql ? atau yang lain ? kalau top processnya, proses apa yang consume cpu/memori banyak ?
mungkin coba install nginx atau varnish aja dulu.. mungkin mungkin bisa membantu..
 

twistedshells

Apprentice 1.0
iya mas bro lambat, padahal di web servernya udah kubikin maksimal untuk MaxClients dan ServerLimit.
maksud dari front end nya menggunakan apa ? web application ? itu apa yah?

@TS: maksudnya front end itu, apakah berbasis web ? atau aplikasi client - server ? Sebagai contoh forum dan web application dengan back end db server mysql/postgresql maka front end nya disebut web based application.

Coba dicek konfigurasi web servernya, atau sekalian copy paste hasil command berikut:

sar 5 5

dan perintah berikut:

top -n 1
 
Status
Not open for further replies.

Top