PDA

View Full Version : MySQL use to much memory


cerebro
Sat 10th Jan '04, 5:34am
Hi, i like to decrease the MySQL memory...but i dont know how.
I thing i have to change some config in my.cnf

The server is a Dual Athlom XP 2.0, 1 Giga mem.


+---------------------------+-----------------+
| Variable_name | Value |
+---------------------------+-----------------+
| Aborted_clients | 14 |
| Aborted_connects | 0 |
| Bytes_received | 801405289 |
| Bytes_sent | 3441416256 |
| Com_admin_commands | 0 |
| Com_alter_table | 0 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 164854 |
| Com_change_master | 0 |
| Com_check | 0 |
| Com_commit | 0 |
| Com_create_db | 0 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 0 |
| Com_delete | 11954 |
| Com_delete_multi | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 0 |
| Com_flush | 0 |
| Com_grant | 0 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_insert | 103490 |
| Com_insert_select | 1373 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 0 |
| Com_optimize | 0 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 0 |
| Com_replace | 6547 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 992808 |
| Com_set_option | 166 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 166 |
| Com_show_databases | 0 |
| Com_show_fields | 166 |
| Com_show_grants | 0 |
| Com_show_keys | 0 |
| Com_show_logs | 0 |
| Com_show_master_status | 0 |
| Com_show_new_master | 0 |
| Com_show_open_tables | 0 |
| Com_show_processlist | 0 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 2 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 168 |
| Com_show_variables | 2 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 316500 |
| Connections | 164862 |
| Created_tmp_disk_tables | 421 |
| Created_tmp_tables | 66716 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 61883 |
| Handler_read_first | 187299 |
| Handler_read_key | 63841940 |
| Handler_read_next | 100293140 |
| Handler_read_prev | 1429989 |
| Handler_read_rnd | 13329750 |
| Handler_read_rnd_next | 162631775 |
| Handler_rollback | 0 |
| Handler_update | 457863 |
| Handler_write | 5665186 |
| Key_blocks_used | 15586 |
| Key_read_requests | 176423210 |
| Key_reads | 671778 |
| Key_write_requests | 351297 |
| Key_writes | 309272 |
| Max_used_connections | 132 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 768 | 75% of table_cache in use
| Open_files | 739 |
| Open_streams | 0 |
| Opened_tables | 774 |
| Questions | 2671983 |
| Qcache_queries_in_cache | 5236 |
| Qcache_inserts | 992009 |
| Qcache_hits | 908935 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 840 |
| Qcache_free_memory | 50948304 |
| Qcache_free_blocks | 2109 |
| Qcache_total_blocks | 12917 |
| Rpl_status | NULL |
| Select_full_join | 31 |
| Select_full_range_join | 26 |
| Select_range | 287895 |
| Select_range_check | 0 |
| Select_scan | 120610 |
| Slave_open_temp_tables | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 1 |
| Slow_queries | 72 | (execution time > 10 secs)
| Sort_merge_passes | 0 |
| Sort_range | 212588 |
| Sort_rows | 18430806 |
| Sort_scan | 63259 |
| Table_locks_immediate | 2902623 |
| Table_locks_waited | 4729 |
| Threads_cached | 14 |
| Threads_created | 422 |
| Threads_connected | 2 |
| Threads_running | 1 |
| Uptime | 133192 | 1 day 12 hrs 59 mins 52 secs
+---------------------------+-----------------+


ETC
[mysqld]
skip-innodb
set-variable = max_connections=300
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=24M
set-variable = join_buffer=1M
set-variable = read_buffer_size=1M
set-variable = record_buffer=3M
set-variable = sort_buffer=3M
set-variable = table_cache=1024
set-variable = thread_cache_size=16
set-variable = wait_timeout=1600
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
set-variable = query_cache_limit=1M
set-variable = query_cache_size=64M
set-variable = query_cache_type=1
[safe_mysqld]
open_files_limit=8192
[mysqldump]
quick
set-variable = max_allowed_packet=16M
[myisamchk]
set-variable = key_buffer=64M
set-variable = sort_buffer=64M
set-variable = read_buffer=16M
set-variable = write_buffer=16M


HTTPD.CONF
Apache Version Apache/1.3.29 (Unix) PHP/4.3.4 MySQL 3.23.49

gtoomey
Sat 10th Jan '04, 6:29am
Set key_buffer to a lower value to reduce mysql memory.

But are you sure you want to do this? Having disk data buffered in memory, whether it is mysql or Apache, resuces disk access and inproves user response time.

cerebro
Sat 10th Jan '04, 1:26pm
Set key_buffer to a lower value to reduce mysql memory.

But are you sure you want to do this? Having disk data buffered in memory, whether it is mysql or Apache, resuces disk access and inproves user response time.
something mysql use too much memory and apache cant response, becauso dont have memory...so for 1 o 2 minutes have to wait until mysql free some memory and can run all again

Zachery
Sat 10th Jan '04, 3:07pm
id suggest giving eva2000 all your server stats and see if he can help :)


also its impossible for it to be dual AMD XP it would need to be DUAL MP's

tell
Sun 11th Jan '04, 9:24am
which is lasted version

cerebro
Mon 12th Jan '04, 12:18pm
Thanks for the help..i will post all the information later to a eva2000 anwser :D