kontrabass
Thu 23rd Oct '03, 6:05pm
Hello!
I'm trying to figure out why I my server inevitably dips into using swap after a day or so of uptime. My Mysqld processes seem to grow and grow and grow in memory usage, and I have to reboot the server every 2 days at least to keep the swap usage down, otherwise things totally lock up (the server load only goes up to around 8 or 9, but the board is totally unresponsive)
Is this the result of a memory leak? I was running mysql 3.23, and just upgraded to 4.0.16 today - no change.
Do I just need more RAM? Are my my.cnf memory settings too generous? I'd really like to stop the swap usage - things run soooo well after a fresh reboot (0 swap used)
Thanks!
Note: the following TOP output is relatively soon after a reboot, so swap usage isn't that drasitic... yet.
1. is this on dedicated or shared virual server
-dedicated
2. Server specs:
Dual Athlon 1800+
1 Gig RAM
2x 18G SCSI
Redhat 7.2
Mysql 4.0.16
PHP 4.1.2
Apache 1.3.27
MMcache installed
3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server ?
NO
4. if possible how mysql was compiled/installed
installed via pre-compiled binaries
5. your top stats
2:45pm up 18:25, 1 user, load average: 1.42, 1.39, 1.20
281 processes: 279 sleeping, 2 running, 0 zombie, 0 stopped
CPU0 states: 20.9% user, 15.26% system, 0.0% nice, 63.26% idle
CPU1 states: 25.20% user, 16.1% system, 0.0% nice, 58.8% idle
Mem: 1028488K av, 1017728K used, 10760K free, 12060K shrd, 6708K buff
Swap: 530104K av, 3844K used, 526260K free 626412K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1164 mysql 9 0 94484 92M 2180 S 8.0 9.1 0:25 mysqld
5668 mysql 9 0 92528 90M 2180 S 7.7 8.9 2:30 mysqld
1166 mysql 9 0 94484 92M 2180 S 6.5 9.1 0:23 mysqld
5663 mysql 14 0 92528 90M 2180 R 4.5 8.9 2:29 mysqld
5557 mysql 9 0 92528 90M 2180 S 4.3 8.9 2:13 mysqld
5604 mysql 9 0 92528 90M 2180 S 2.5 8.9 2:55 mysqld
6135 mysql 9 0 94484 92M 2180 S 2.4 9.1 2:53 mysqld
6504 paul 14 0 1276 1276 856 R 2.0 0.1 0:17 top
5958 nobody 9 0 6968 6780 5392 S 1.4 0.6 0:04 httpd
6971 nobody 9 0 5596 5404 4312 S 1.3 0.5 0:01 httpd
27145 nobody 9 0 8504 7996 6560 S 1.2 0.7 0:38 httpd
7058 nobody 9 0 5848 5656 4436 S 1.2 0.5 0:00 httpd
6875 nobody 9 0 6088 5900 4672 S 1.1 0.5 0:00 httpd
1170 mysql 9 0 94484 92M 2180 S 1.0 9.1 0:33 mysqld
5519 mysql 9 0 92528 90M 2180 S 0.8 8.9 3:23 mysqld
5661 mysql 9 0 92528 90M 2180 S 0.8 8.9 2:22 mysqld
7019 nobody 9 0 5388 5200 4552 S 0.8 0.5 0:00 httpd
5817 nobody 9 0 7404 7216 5836 S 0.7 0.7 0:04 httpd
6969 nobody 9 0 5760 5568 4472 S 0.7 0.5 0:00 httpd
6. your mysql configuration variables located at /etc/my.cnf
| back_log | 50 |
| basedir | /usr/local/mysql/ |
| binlog_cache_size | 32768 |
| bulk_insert_buffer_size | 8388608 |
| character_set | latin1 |
| character_sets | latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 |
| concurrent_insert | ON |
| connect_timeout | 10 |
| convert_character_set | |
| datadir | /mysql/data/ |
| default_week_format | 0 |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| flush | OFF |
| flush_time | 0 |
| ft_boolean_syntax | + -><()~*:""&| |
| ft_min_word_len | 4 |
| ft_max_word_len | 254 |
| ft_max_word_len_for_sort | 20 |
| ft_stopword_file | (built-in) |
| have_bdb | NO |
| have_crypt | YES |
| have_innodb | DISABLED |
| have_isam | YES |
| have_raid | NO |
| have_symlink | YES |
| have_openssl | NO |
| have_query_cache | YES |
| init_file | |
| innodb_additional_mem_pool_size | 1048576 |
| innodb_buffer_pool_size | 8388608 |
| innodb_data_file_path | |
| innodb_data_home_dir | |
| innodb_file_io_threads | 4 |
| innodb_force_recovery | 0 |
| innodb_thread_concurrency | 8 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_fast_shutdown | ON |
| innodb_flush_method | |
| innodb_lock_wait_timeout | 50 |
| innodb_log_arch_dir | |
| innodb_log_archive | OFF |
| innodb_log_buffer_size | 1048576 |
| innodb_log_file_size | 5242880 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | |
| innodb_mirrored_log_groups | 1 |
| innodb_max_dirty_pages_pct | 90 |
| interactive_timeout | 28800 |
| join_buffer_size | 1044480 |
| key_buffer_size | 16777216 |
| language | /usr/local/mysql/share/mysql/english/ |
| large_files_support | ON |
| local_infile | ON |
| locked_in_memory | OFF |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_warnings | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | OFF |
| max_allowed_packet | 16776192 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_connections | 400 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_relay_log_size | 0 |
| max_seeks_for_key | 4294967295 |
| max_sort_length | 1024 |
| max_user_connections | 0 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_max_extra_sort_file_size | 268435456 |
| myisam_max_sort_file_size | 2147483647 |
| myisam_repair_threads | 1 |
| myisam_recover_options | OFF |
| myisam_sort_buffer_size | 67108864 |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| new | OFF |
| open_files_limit | 2458 |
| pid_file | /mysql/data/argus.talkbass.com.pid |
| log_error | |
| port | 3306 |
| protocol_version | 10 |
| query_alloc_block_size | 8192 |
| query_cache_limit | 1048576 |
| query_cache_size | 33554432 |
| query_cache_type | ON |
| query_prealloc_size | 8192 |
| range_alloc_block_size | 2048 |
| read_buffer_size | 2093056 |
| read_only | OFF |
| read_rnd_buffer_size | 262144 |
| rpl_recovery_rank | 0 |
| server_id | 1 |
| slave_net_timeout | 3600 |
| skip_external_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | /tmp/mysql.sock |
| sort_buffer_size | 2097144 |
| sql_mode | 0 |
| table_cache | 1024 |
| table_type | MYISAM |
| thread_cache_size | 128 |
| thread_stack | 126976 |
| tx_isolation | REPEATABLE-READ |
| timezone | MDT |
| tmp_table_size | 33554432 |
| tmpdir | /tmp/ |
| transaction_alloc_block_size | 8192 |
| transaction_prealloc_size | 4096 |
| version | 4.0.16-standard |
| wait_timeout | 1800 |
7. your mysql extended-status output
http://www.talkbass.com/mysqlinfo.php
8. oh and is your vB the only thing on the server? or other scripts? sites?
phpNuke, phpAdsNew delivers ads (php-mysql ad delivery)
9. how many average and max concurrent users on your vB forum ?
average = 129
max = 240
10. create a file named phpinfo.php and place this code in it and post the url/link to it from your web site
http://www.talkbass.com/phpinfo.php
11. if you run Apache and you have your own dedicated server or access to your httpd.conf (apache configuration file) can you post the values you have set for the following :
KeepAlive ON
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
12. what version of vB are you running ?
2.2.3
I'm trying to figure out why I my server inevitably dips into using swap after a day or so of uptime. My Mysqld processes seem to grow and grow and grow in memory usage, and I have to reboot the server every 2 days at least to keep the swap usage down, otherwise things totally lock up (the server load only goes up to around 8 or 9, but the board is totally unresponsive)
Is this the result of a memory leak? I was running mysql 3.23, and just upgraded to 4.0.16 today - no change.
Do I just need more RAM? Are my my.cnf memory settings too generous? I'd really like to stop the swap usage - things run soooo well after a fresh reboot (0 swap used)
Thanks!
Note: the following TOP output is relatively soon after a reboot, so swap usage isn't that drasitic... yet.
1. is this on dedicated or shared virual server
-dedicated
2. Server specs:
Dual Athlon 1800+
1 Gig RAM
2x 18G SCSI
Redhat 7.2
Mysql 4.0.16
PHP 4.1.2
Apache 1.3.27
MMcache installed
3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server ?
NO
4. if possible how mysql was compiled/installed
installed via pre-compiled binaries
5. your top stats
2:45pm up 18:25, 1 user, load average: 1.42, 1.39, 1.20
281 processes: 279 sleeping, 2 running, 0 zombie, 0 stopped
CPU0 states: 20.9% user, 15.26% system, 0.0% nice, 63.26% idle
CPU1 states: 25.20% user, 16.1% system, 0.0% nice, 58.8% idle
Mem: 1028488K av, 1017728K used, 10760K free, 12060K shrd, 6708K buff
Swap: 530104K av, 3844K used, 526260K free 626412K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1164 mysql 9 0 94484 92M 2180 S 8.0 9.1 0:25 mysqld
5668 mysql 9 0 92528 90M 2180 S 7.7 8.9 2:30 mysqld
1166 mysql 9 0 94484 92M 2180 S 6.5 9.1 0:23 mysqld
5663 mysql 14 0 92528 90M 2180 R 4.5 8.9 2:29 mysqld
5557 mysql 9 0 92528 90M 2180 S 4.3 8.9 2:13 mysqld
5604 mysql 9 0 92528 90M 2180 S 2.5 8.9 2:55 mysqld
6135 mysql 9 0 94484 92M 2180 S 2.4 9.1 2:53 mysqld
6504 paul 14 0 1276 1276 856 R 2.0 0.1 0:17 top
5958 nobody 9 0 6968 6780 5392 S 1.4 0.6 0:04 httpd
6971 nobody 9 0 5596 5404 4312 S 1.3 0.5 0:01 httpd
27145 nobody 9 0 8504 7996 6560 S 1.2 0.7 0:38 httpd
7058 nobody 9 0 5848 5656 4436 S 1.2 0.5 0:00 httpd
6875 nobody 9 0 6088 5900 4672 S 1.1 0.5 0:00 httpd
1170 mysql 9 0 94484 92M 2180 S 1.0 9.1 0:33 mysqld
5519 mysql 9 0 92528 90M 2180 S 0.8 8.9 3:23 mysqld
5661 mysql 9 0 92528 90M 2180 S 0.8 8.9 2:22 mysqld
7019 nobody 9 0 5388 5200 4552 S 0.8 0.5 0:00 httpd
5817 nobody 9 0 7404 7216 5836 S 0.7 0.7 0:04 httpd
6969 nobody 9 0 5760 5568 4472 S 0.7 0.5 0:00 httpd
6. your mysql configuration variables located at /etc/my.cnf
| back_log | 50 |
| basedir | /usr/local/mysql/ |
| binlog_cache_size | 32768 |
| bulk_insert_buffer_size | 8388608 |
| character_set | latin1 |
| character_sets | latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 |
| concurrent_insert | ON |
| connect_timeout | 10 |
| convert_character_set | |
| datadir | /mysql/data/ |
| default_week_format | 0 |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| flush | OFF |
| flush_time | 0 |
| ft_boolean_syntax | + -><()~*:""&| |
| ft_min_word_len | 4 |
| ft_max_word_len | 254 |
| ft_max_word_len_for_sort | 20 |
| ft_stopword_file | (built-in) |
| have_bdb | NO |
| have_crypt | YES |
| have_innodb | DISABLED |
| have_isam | YES |
| have_raid | NO |
| have_symlink | YES |
| have_openssl | NO |
| have_query_cache | YES |
| init_file | |
| innodb_additional_mem_pool_size | 1048576 |
| innodb_buffer_pool_size | 8388608 |
| innodb_data_file_path | |
| innodb_data_home_dir | |
| innodb_file_io_threads | 4 |
| innodb_force_recovery | 0 |
| innodb_thread_concurrency | 8 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_fast_shutdown | ON |
| innodb_flush_method | |
| innodb_lock_wait_timeout | 50 |
| innodb_log_arch_dir | |
| innodb_log_archive | OFF |
| innodb_log_buffer_size | 1048576 |
| innodb_log_file_size | 5242880 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | |
| innodb_mirrored_log_groups | 1 |
| innodb_max_dirty_pages_pct | 90 |
| interactive_timeout | 28800 |
| join_buffer_size | 1044480 |
| key_buffer_size | 16777216 |
| language | /usr/local/mysql/share/mysql/english/ |
| large_files_support | ON |
| local_infile | ON |
| locked_in_memory | OFF |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_warnings | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | OFF |
| max_allowed_packet | 16776192 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_connections | 400 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_relay_log_size | 0 |
| max_seeks_for_key | 4294967295 |
| max_sort_length | 1024 |
| max_user_connections | 0 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_max_extra_sort_file_size | 268435456 |
| myisam_max_sort_file_size | 2147483647 |
| myisam_repair_threads | 1 |
| myisam_recover_options | OFF |
| myisam_sort_buffer_size | 67108864 |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| new | OFF |
| open_files_limit | 2458 |
| pid_file | /mysql/data/argus.talkbass.com.pid |
| log_error | |
| port | 3306 |
| protocol_version | 10 |
| query_alloc_block_size | 8192 |
| query_cache_limit | 1048576 |
| query_cache_size | 33554432 |
| query_cache_type | ON |
| query_prealloc_size | 8192 |
| range_alloc_block_size | 2048 |
| read_buffer_size | 2093056 |
| read_only | OFF |
| read_rnd_buffer_size | 262144 |
| rpl_recovery_rank | 0 |
| server_id | 1 |
| slave_net_timeout | 3600 |
| skip_external_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | /tmp/mysql.sock |
| sort_buffer_size | 2097144 |
| sql_mode | 0 |
| table_cache | 1024 |
| table_type | MYISAM |
| thread_cache_size | 128 |
| thread_stack | 126976 |
| tx_isolation | REPEATABLE-READ |
| timezone | MDT |
| tmp_table_size | 33554432 |
| tmpdir | /tmp/ |
| transaction_alloc_block_size | 8192 |
| transaction_prealloc_size | 4096 |
| version | 4.0.16-standard |
| wait_timeout | 1800 |
7. your mysql extended-status output
http://www.talkbass.com/mysqlinfo.php
8. oh and is your vB the only thing on the server? or other scripts? sites?
phpNuke, phpAdsNew delivers ads (php-mysql ad delivery)
9. how many average and max concurrent users on your vB forum ?
average = 129
max = 240
10. create a file named phpinfo.php and place this code in it and post the url/link to it from your web site
http://www.talkbass.com/phpinfo.php
11. if you run Apache and you have your own dedicated server or access to your httpd.conf (apache configuration file) can you post the values you have set for the following :
KeepAlive ON
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
12. what version of vB are you running ?
2.2.3