max_memory_limit_mysql.sh: add 'max_allowed_packet' which is also relevant for maximum memory usage.
This commit is contained in:
		
							
								
								
									
										113
									
								
								databases-web0-alt.lst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										113
									
								
								databases-web0-alt.lst
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,113 @@ | |||||||
|  | 123comics | ||||||
|  | abw | ||||||
|  | abw_kita | ||||||
|  | abw_sprachschule | ||||||
|  | alphabuendnis_cw | ||||||
|  | alternative_wipo | ||||||
|  | andreafrank | ||||||
|  | annen | ||||||
|  | arbeitszeittuev | ||||||
|  | artikelbox | ||||||
|  | bause | ||||||
|  | birkwald | ||||||
|  | birkwald2 | ||||||
|  | bit6neu | ||||||
|  | bksf | ||||||
|  | bluefrog | ||||||
|  | cafe_hudl | ||||||
|  | callinus | ||||||
|  | dacapo | ||||||
|  | demasi | ||||||
|  | demasi2 | ||||||
|  | diakonieverbund | ||||||
|  | dialogstiftung | ||||||
|  | dijv | ||||||
|  | dspp | ||||||
|  | egypt_at_work | ||||||
|  | ejh_bochum | ||||||
|  | ejh_geltow | ||||||
|  | ejh_schweicheln | ||||||
|  | emt_zentralrat | ||||||
|  | ensemble1800 | ||||||
|  | faireintegra2021 | ||||||
|  | faireintegration | ||||||
|  | faire_mob_db | ||||||
|  | faire_mob_dbdemo | ||||||
|  | faire_mobilitaet | ||||||
|  | fgmm | ||||||
|  | frauencoaching | ||||||
|  | freieschule | ||||||
|  | gambio2 | ||||||
|  | gender | ||||||
|  | gerechtigkeittv | ||||||
|  | gleichstellung3 | ||||||
|  | gleichstellungsbericht | ||||||
|  | green_economy | ||||||
|  | haendel2 | ||||||
|  | hedtfeld | ||||||
|  | hellepanke | ||||||
|  | hellepankeold | ||||||
|  | hillel | ||||||
|  | hoff | ||||||
|  | information_schema | ||||||
|  | iponphoto | ||||||
|  | jao | ||||||
|  | jongleur_till | ||||||
|  | kescher | ||||||
|  | keshet | ||||||
|  | kilele | ||||||
|  | kilele_test | ||||||
|  | kipping2 | ||||||
|  | kleinpetersberg | ||||||
|  | klute2 | ||||||
|  | koall | ||||||
|  | kontext3 | ||||||
|  | kontext3_test | ||||||
|  | kontext_cms | ||||||
|  | kontextdemo | ||||||
|  | korte | ||||||
|  | langensiepen | ||||||
|  | lay3 | ||||||
|  | lebenlernen | ||||||
|  | liebich3 | ||||||
|  | linkeeu | ||||||
|  | links_bewegt | ||||||
|  | lsvrlp_kontext3 | ||||||
|  | mysql | ||||||
|  | netzwerkstatt | ||||||
|  | performance_schema | ||||||
|  | photoforwork | ||||||
|  | platinit | ||||||
|  | pragerfruehling | ||||||
|  | rabbinerordination | ||||||
|  | radialstiftung | ||||||
|  | roespel | ||||||
|  | rosalux_eu | ||||||
|  | schalauske | ||||||
|  | schindler | ||||||
|  | scholz | ||||||
|  | schreiber | ||||||
|  | schwabe | ||||||
|  | shadesillegality | ||||||
|  | solimod | ||||||
|  | sopoinfo | ||||||
|  | spa_test | ||||||
|  | spd_laage | ||||||
|  | sprachenatelier | ||||||
|  | sprachenatelier3 | ||||||
|  | sprachenatelier4 | ||||||
|  | spriesterbach | ||||||
|  | stressbarometer | ||||||
|  | stressbarometer_igm | ||||||
|  | sys | ||||||
|  | test | ||||||
|  | trabant | ||||||
|  | troost | ||||||
|  | tsc_project | ||||||
|  | ttip | ||||||
|  | tvet_indonesia | ||||||
|  | unconference_rsa | ||||||
|  | wagenknecht2 | ||||||
|  | wfinterim | ||||||
|  | willems | ||||||
|  | wwl_intellektuelle | ||||||
| @@ -26,13 +26,17 @@ fi | |||||||
| declare -i key_buffer_size | declare -i key_buffer_size | ||||||
| declare -i query_cache_size | declare -i query_cache_size | ||||||
| declare -i tmp_table_size | declare -i tmp_table_size | ||||||
|  | declare -i max_heap_table_size | ||||||
|  | declare -i max_tmp_table_size | ||||||
| declare -i innodb_buffer_pool_size | declare -i innodb_buffer_pool_size | ||||||
| declare -i innodb_additional_mem_pool_size | declare -i innodb_additional_mem_pool_size | ||||||
| declare -i innodb_log_buffer_size  | declare -i innodb_log_buffer_size  | ||||||
|  | declare -i aria_pagecache_buffer_size | ||||||
| declare -i max_connections | declare -i max_connections | ||||||
| declare -i sort_buffer_size | declare -i sort_buffer_size | ||||||
| declare -i read_buffer_size  | declare -i read_buffer_size  | ||||||
| declare -i read_rnd_buffer_size | declare -i read_rnd_buffer_size | ||||||
|  | declare -i max_allowed_packet | ||||||
| declare -i join_buffer_size | declare -i join_buffer_size | ||||||
| declare -i thread_stack | declare -i thread_stack | ||||||
| declare -i binlog_cache_size  | declare -i binlog_cache_size  | ||||||
| @@ -43,12 +47,16 @@ query_cache_size=`mysql $mysql_credential_args -N -s -e \ | |||||||
|    "SHOW VARIABLES LIKE 'query_cache_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'query_cache_size'" | awk '{print$2}'` | ||||||
| tmp_table_size=`mysql $mysql_credential_args -N -s -e \ | tmp_table_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'tmp_table_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'tmp_table_size'" | awk '{print$2}'` | ||||||
|  | max_heap_table_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|  |    "SHOW VARIABLES LIKE 'max_heap_table_size'" | awk '{print$2}'` | ||||||
| innodb_buffer_pool_size=`mysql $mysql_credential_args -N -s -e \ | innodb_buffer_pool_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'innodb_buffer_pool_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'innodb_buffer_pool_size'" | awk '{print$2}'` | ||||||
| innodb_additional_mem_pool_size=`mysql $mysql_credential_args -N -s -e \ | innodb_additional_mem_pool_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'innodb_additional_mem_pool_size'" | awk '{print$2}'` | ||||||
| innodb_log_buffer_size=`mysql $mysql_credential_args -N -s -e \ | innodb_log_buffer_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'innodb_log_buffer_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'innodb_log_buffer_size'" | awk '{print$2}'` | ||||||
|  | aria_pagecache_buffer_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|  |    "SHOW VARIABLES LIKE 'aria_pagecache_buffer_size'" | awk '{print$2}'` | ||||||
| max_connections=`mysql $mysql_credential_args -N -s -e \ | max_connections=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'max_connections'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'max_connections'" | awk '{print$2}'` | ||||||
| sort_buffer_size=`mysql $mysql_credential_args -N -s -e \ | sort_buffer_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
| @@ -59,6 +67,8 @@ read_rnd_buffer_size=`mysql $mysql_credential_args -N -s -e \ | |||||||
|    "SHOW VARIABLES LIKE 'read_rnd_buffer_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'read_rnd_buffer_size'" | awk '{print$2}'` | ||||||
| join_buffer_size=`mysql $mysql_credential_args -N -s -e \ | join_buffer_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'join_buffer_size'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'join_buffer_size'" | awk '{print$2}'` | ||||||
|  | max_allowed_packet=`mysql $mysql_credential_args -N -s -e \ | ||||||
|  |    "SHOW VARIABLES LIKE 'max_allowed_packet'" | awk '{print$2}'` | ||||||
| thread_stack=`mysql $mysql_credential_args -N -s -e \ | thread_stack=`mysql $mysql_credential_args -N -s -e \ | ||||||
|    "SHOW VARIABLES LIKE 'thread_stack'" | awk '{print$2}'` |    "SHOW VARIABLES LIKE 'thread_stack'" | awk '{print$2}'` | ||||||
| binlog_cache_size=`mysql $mysql_credential_args -N -s -e \ | binlog_cache_size=`mysql $mysql_credential_args -N -s -e \ | ||||||
| @@ -120,6 +130,13 @@ elif [ $tmp_table_size -gt 1024 ]; then | |||||||
|    _tmp_table_size=" (`expr $tmp_table_size / 1024`K)" |    _tmp_table_size=" (`expr $tmp_table_size / 1024`K)" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | _max_heap_table_size="" | ||||||
|  | if [ $max_heap_table_size -gt 1048576 ]; then | ||||||
|  |    _max_heap_table_size=" (`expr $max_heap_table_size / 1024 / 1024`M)" | ||||||
|  | elif [ $max_heap_table_size -gt 1024 ]; then | ||||||
|  |    _max_heap_table_size=" (`expr $max_heap_table_size / 1024`K)" | ||||||
|  | fi | ||||||
|  |  | ||||||
| _innodb_buffer_pool_size="" | _innodb_buffer_pool_size="" | ||||||
| if [ $innodb_buffer_pool_size -gt 1048576 ]; then | if [ $innodb_buffer_pool_size -gt 1048576 ]; then | ||||||
|    _innodb_buffer_pool_size=" (`expr $innodb_buffer_pool_size / 1024 / 1024`M)" |    _innodb_buffer_pool_size=" (`expr $innodb_buffer_pool_size / 1024 / 1024`M)" | ||||||
| @@ -141,6 +158,13 @@ elif [ $innodb_log_buffer_size -gt 1024 ]; then | |||||||
|    _innodb_log_buffer_size=" (`expr $innodb_log_buffer_size / 1024`K)" |    _innodb_log_buffer_size=" (`expr $innodb_log_buffer_size / 1024`K)" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | _aria_pagecache_buffer_size="" | ||||||
|  | if [ $aria_pagecache_buffer_size -gt 1048576 ]; then | ||||||
|  |    _aria_pagecache_buffer_size=" (`expr $aria_pagecache_buffer_size / 1024 / 1024`M)" | ||||||
|  | elif [ $aria_pagecache_buffer_size -gt 1024 ]; then | ||||||
|  |    _aria_pagecache_buffer_size=" (`expr $aria_pagecache_buffer_size / 1024`K)" | ||||||
|  | fi | ||||||
|  |  | ||||||
| _sort_buffer_size="" | _sort_buffer_size="" | ||||||
| if [ $sort_buffer_size -gt 1048576 ]; then | if [ $sort_buffer_size -gt 1048576 ]; then | ||||||
|    _sort_buffer_size=" (`expr $sort_buffer_size / 1024 / 1024`M)" |    _sort_buffer_size=" (`expr $sort_buffer_size / 1024 / 1024`M)" | ||||||
| @@ -169,6 +193,13 @@ elif [ $join_buffer_size -gt 1024 ]; then | |||||||
|    _join_buffer_size=" (`expr $join_buffer_size / 1024`K)" |    _join_buffer_size=" (`expr $join_buffer_size / 1024`K)" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | _max_allowed_packet="" | ||||||
|  | if [ $max_allowed_packet -gt 1048576 ]; then | ||||||
|  |    _max_allowed_packet=" (`expr $max_allowed_packet / 1024 / 1024`M)" | ||||||
|  | elif [ $max_allowed_packet -gt 1024 ]; then | ||||||
|  |    _max_allowed_packet=" (`expr $max_allowed_packet / 1024`K)" | ||||||
|  | fi | ||||||
|  |  | ||||||
| _thread_stack="" | _thread_stack="" | ||||||
| if [ $thread_stack -gt 1048576 ]; then | if [ $thread_stack -gt 1048576 ]; then | ||||||
|    _thread_stack=" (`expr $thread_stack / 1024 / 1024`M)" |    _thread_stack=" (`expr $thread_stack / 1024 / 1024`M)" | ||||||
| @@ -183,14 +214,30 @@ elif [ $binlog_cache_size -gt 1024 ]; then | |||||||
|    _binlog_cache_size=" (`expr $binlog_cache_size / 1024`K)" |    _binlog_cache_size=" (`expr $binlog_cache_size / 1024`K)" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | if [ $max_heap_table_size -gt $tmp_table_size ] ; then | ||||||
|  |    max_tmp_table_size=$max_heap_table_size | ||||||
|  | else | ||||||
|  |    max_tmp_table_size=$tmp_table_size | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | _max_tmp_table_size="" | ||||||
|  | if [ $max_tmp_table_size -gt 1048576 ]; then | ||||||
|  |    _max_tmp_table_size=" (`expr $max_tmp_table_size / 1024 / 1024`M)" | ||||||
|  | elif [ $max_tmp_table_size -gt 1024 ]; then | ||||||
|  |    _max_tmp_table_size=" (`expr $maxtmpp_table_size / 1024`K)" | ||||||
|  | fi | ||||||
|  |  | ||||||
| echo -e "\tGlobal Buffers" | echo -e "\tGlobal Buffers" | ||||||
| echo -e "\t--------------" | echo -e "\t--------------" | ||||||
| echo -e "\tkey_buffer_size...................: $key_buffer_size $_key_buffer_size" | echo -e "\tkey_buffer_size...................: $key_buffer_size $_key_buffer_size" | ||||||
| echo -e "\tquery_cache_size..................: $query_cache_size $_query_cache_size" | echo -e "\tquery_cache_size..................: $query_cache_size $_query_cache_size" | ||||||
| echo -e "\ttmp_table_size....................: $tmp_table_size $_tmp_table_size" | echo -e "\tmax_tmp_table_size................: $max_tmp_table_size $_max_tmp_table_size" | ||||||
|  | echo -e "\t   tmp_table_size.................: $tmp_table_size $_tmp_table_size" | ||||||
|  | echo -e "\t   max_heap_table_size............: $max_heap_table_size $_max_heap_table_size" | ||||||
| echo -e "\tinnodb_buffer_pool_size...........: $innodb_buffer_pool_size $_innodb_buffer_pool_size" | echo -e "\tinnodb_buffer_pool_size...........: $innodb_buffer_pool_size $_innodb_buffer_pool_size" | ||||||
| echo -e "\tinnodb_additional_mem_pool_size...: $innodb_additional_mem_pool_size $_innodb_additional_mem_pool_size" | echo -e "\tinnodb_additional_mem_pool_size...: $innodb_additional_mem_pool_size $_innodb_additional_mem_pool_size" | ||||||
| echo -e "\tinnodb_log_buffer_size............: $innodb_log_buffer_size $_innodb_log_buffer_size" | echo -e "\tinnodb_log_buffer_size............: $innodb_log_buffer_size $_innodb_log_buffer_size" | ||||||
|  | echo -e "\taria_pagecache_buffer_size........: $aria_pagecache_buffer_size $_aria_pagecache_buffer_size" | ||||||
| echo "" | echo "" | ||||||
| echo -e "\tmax_connections...................: $max_connections" | echo -e "\tmax_connections...................: $max_connections" | ||||||
| echo "" | echo "" | ||||||
| @@ -200,20 +247,23 @@ echo -e "\tsort_buffer_size..................: $sort_buffer_size $_sort_buffer_s | |||||||
| echo -e "\tread_buffer_size..................: $read_buffer_size $_read_buffer_size" | echo -e "\tread_buffer_size..................: $read_buffer_size $_read_buffer_size" | ||||||
| echo -e "\tread_rnd_buffer_size..............: $read_rnd_buffer_size $_read_rnd_buffer_size" | echo -e "\tread_rnd_buffer_size..............: $read_rnd_buffer_size $_read_rnd_buffer_size" | ||||||
| echo -e "\tjoin_buffer_size..................: $join_buffer_size $_join_buffer_size" | echo -e "\tjoin_buffer_size..................: $join_buffer_size $_join_buffer_size" | ||||||
|  | echo -e "\tmax_allowed_packet................: $max_allowed_packet $_max_allowed_packet" | ||||||
| echo -e "\tthread_stack......................: $thread_stack $_thread_stack" | echo -e "\tthread_stack......................: $thread_stack $_thread_stack" | ||||||
| echo -e "\tbinlog_cache_size.................: $binlog_cache_size $_binlog_cache_size" | echo -e "\tbinlog_cache_size.................: $binlog_cache_size $_binlog_cache_size" | ||||||
|  |  | ||||||
| declare -i max_memory_usage | declare -i max_memory_usage | ||||||
| max_memory_usage=`expr $key_buffer_size \ | max_memory_usage=`expr $key_buffer_size \ | ||||||
|                        + $query_cache_size \ |                        + $query_cache_size \ | ||||||
|                        + $tmp_table_size \ |                        + $max_tmp_table_size \ | ||||||
|                        + $innodb_buffer_pool_size \ |                        + $innodb_buffer_pool_size \ | ||||||
|                        + $innodb_additional_mem_pool_size \ |                        + $innodb_additional_mem_pool_size \ | ||||||
|                        + $innodb_log_buffer_size \ |                        + $innodb_log_buffer_size \ | ||||||
|  |                        + $aria_pagecache_buffer_size \ | ||||||
|                        + $max_connections \* \( $sort_buffer_size \ |                        + $max_connections \* \( $sort_buffer_size \ | ||||||
|                                               + $read_buffer_size \ |                                               + $read_buffer_size \ | ||||||
|                                               + $read_rnd_buffer_size \ |                                               + $read_rnd_buffer_size \ | ||||||
|                                               + $join_buffer_size \ |                                               + $join_buffer_size \ | ||||||
|  |                                               + $max_allowed_packet \ | ||||||
|                                               + $thread_stack \ |                                               + $thread_stack \ | ||||||
|                                               + $binlog_cache_size \)` |                                               + $binlog_cache_size \)` | ||||||
|  |  | ||||||
| @@ -224,14 +274,16 @@ max_memory_usage_mb=`expr $max_memory_usage / 1024 / 1024` | |||||||
| declare -i max_memory_allocated | declare -i max_memory_allocated | ||||||
| max_memory_allocated=`expr $key_buffer_size \ | max_memory_allocated=`expr $key_buffer_size \ | ||||||
|                          + $query_cache_size \ |                          + $query_cache_size \ | ||||||
|                          + $tmp_table_size \ |                          + $max_tmp_table_size \ | ||||||
|                          + $innodb_buffer_pool_size \ |                          + $innodb_buffer_pool_size \ | ||||||
|                          + $innodb_additional_mem_pool_size \ |                          + $innodb_additional_mem_pool_size \ | ||||||
|                          + $innodb_log_buffer_size \ |                          + $innodb_log_buffer_size \ | ||||||
|  |                          + $aria_pagecache_buffer_size \ | ||||||
|                          + $max_used_connections \* \( $sort_buffer_size \ |                          + $max_used_connections \* \( $sort_buffer_size \ | ||||||
|                                                      + $read_buffer_size \ |                                                      + $read_buffer_size \ | ||||||
|                                                      + $read_rnd_buffer_size \ |                                                      + $read_rnd_buffer_size \ | ||||||
|                                                      + $join_buffer_size \ |                                                      + $join_buffer_size \ | ||||||
|  |                                                      + $max_allowed_packet \ | ||||||
|                                                      + $thread_stack \ |                                                      + $thread_stack \ | ||||||
|                                                      + $binlog_cache_size \)` |                                                      + $binlog_cache_size \)` | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user