全球主机交流论坛

标题: MariaDB其实很占内存 [打印本页]

作者: star826    时间: 2013-1-1 21:31
提示: 作者被禁止或删除 内容自动屏蔽
作者: wdlth    时间: 2013-1-1 21:32
我还加了Google Perftools,差不多500M……
作者: ☆校长☆    时间: 2013-1-1 21:32
是呀是呀,怎么破?
作者: adn    时间: 2013-1-1 21:32
呵呵 那是坑定的
作者: star826    时间: 2013-1-1 21:37
提示: 作者被禁止或删除 内容自动屏蔽
作者: paopao00    时间: 2013-1-1 21:39
据说性能不错
作者: wdlth    时间: 2013-1-1 21:43
本帖最后由 wdlth 于 2013-1-1 21:44 编辑
star826 发表于 2013-1-1 21:37
你是怎么配置的。能给个配置信息出来么


用large那个改
max_connections = 100
key_buffer_size = 64M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 8M
thread_cache_size = 8
query_cache_size= 8M
还有
innodb_buffer_pool_size = 64M
不过我的数据太多,低了就慢了。
作者: star826    时间: 2013-1-1 21:43
提示: 作者被禁止或删除 内容自动屏蔽
作者: star826    时间: 2013-1-1 21:44
提示: 作者被禁止或删除 内容自动屏蔽
作者: malsvent    时间: 2013-1-1 21:51
提示: 作者被禁止或删除 内容自动屏蔽
作者: star826    时间: 2013-1-1 22:02
提示: 作者被禁止或删除 内容自动屏蔽
作者: star826    时间: 2013-1-1 23:49
提示: 作者被禁止或删除 内容自动屏蔽
作者: wdlth    时间: 2013-1-2 00:01
star826 发表于 2013-1-1 23:49
还想问下你是ovz还是xen测试的?我ds测试是525m

kvm,不过是用了几天的,重启后大概三百M这样。主要还是存储引擎占得多。
作者: 诡谲    时间: 2013-1-2 00:37
七楼的参数比我还保守。
作者: star826    时间: 2013-1-2 12:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: star826    时间: 2013-1-2 12:50
提示: 作者被禁止或删除 内容自动屏蔽
作者: 小晖    时间: 2013-1-2 13:00
我自己机win下也用过。

一下子去了我1G.

后来我就没在用了。还是用 5.1

作者: wdlth    时间: 2013-1-2 13:13
诡谲 发表于 2013-1-2 00:37
七楼的参数比我还保守。

缓存都设128就太恐怖了
作者: 难人    时间: 2013-1-2 13:18
?????????
作者: Kvm    时间: 2013-1-2 13:31
我都是在8G和32G的机器上装LAMP环境 所有内存开销调整到最大
作者: star826    时间: 2013-1-2 13:48
提示: 作者被禁止或删除 内容自动屏蔽
作者: renothing    时间: 2013-1-2 14:31
想节约内存,别用Mysql InnoDB
SQLite 最好了。
作者: 诡谲    时间: 2013-1-2 16:21
只用MyISAM占用内存并不多。开了InnoDB之后,也可以做到省内存,但是太节约内存也许会造成响应变慢。
  1. MariaDB [(none)]> show engines;
  2. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  3. | Engine             | Support | Comment                                                                    | Transactions | XA   | Savepoints |
  4. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  5. | MyISAM             | YES     | MyISAM storage engine                                                      | NO           | NO   | NO         |
  6. | CSV                | YES     | CSV storage engine                                                         | NO           | NO   | NO         |
  7. | MRG_MYISAM         | YES     | Collection of identical MyISAM tables                                      | NO           | NO   | NO         |
  8. | BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears)             | NO           | NO   | NO         |
  9. | MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                  | NO           | NO   | NO         |
  10. | PERFORMANCE_SCHEMA | YES     | Performance Schema                                                         | NO           | NO   | NO         |
  11. | ARCHIVE            | YES     | Archive storage engine                                                     | NO           | NO   | NO         |
  12. | FEDERATED          | YES     | FederatedX pluggable storage engine                                        | YES          | NO   | YES        |
  13. | InnoDB             | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
  14. | Aria               | YES     | Crash-safe tables with MyISAM heritage                                     | NO           | NO   | NO         |
  15. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  16. 10 rows in set (0.00 sec)
复制代码

  1. MariaDB [(none)]> show variables like 'innodb_%';
  2. +-------------------------------------------+-------------------------+
  3. | Variable_name                             | Value                   |
  4. +-------------------------------------------+-------------------------+
  5. | innodb_adaptive_flushing                  | ON                      |
  6. | innodb_adaptive_flushing_method           | estimate                |
  7. | innodb_adaptive_hash_index                | ON                      |
  8. | innodb_adaptive_hash_index_partitions     | 1                       |
  9. | innodb_additional_mem_pool_size           | 16777216                |
  10. | innodb_autoextend_increment               | 8                       |
  11. | innodb_autoinc_lock_mode                  | 1                       |
  12. | innodb_blocking_buffer_pool_restore       | OFF                     |
  13. | innodb_buffer_pool_instances              | 1                       |
  14. | innodb_buffer_pool_restore_at_startup     | 0                       |
  15. | innodb_buffer_pool_shm_checksum           | ON                      |
  16. | innodb_buffer_pool_shm_key                | 0                       |
  17. | innodb_buffer_pool_size                   | 268435456               |
  18. | innodb_change_buffering                   | all                     |
  19. | innodb_checkpoint_age_target              | 0                       |
  20. | innodb_checksums                          | ON                      |
  21. | innodb_commit_concurrency                 | 0                       |
  22. | innodb_concurrency_tickets                | 500                     |
  23. | innodb_corrupt_table_action               | assert                  |
  24. | innodb_data_file_path                     | ibdata1:100M:autoextend |
  25. | innodb_data_home_dir                      |                         |
  26. | innodb_dict_size_limit                    | 0                       |
  27. | innodb_doublewrite                        | ON                      |
  28. | innodb_doublewrite_file                   |                         |
  29. | innodb_fake_changes                       | OFF                     |
  30. | innodb_fast_checksum                      | OFF                     |
  31. | innodb_fast_shutdown                      | 1                       |
  32. | innodb_file_format                        | Antelope                |
  33. | innodb_file_format_check                  | ON                      |
  34. | innodb_file_format_max                    | Antelope                |
  35. | innodb_file_per_table                     | OFF                     |
  36. | innodb_flush_log_at_trx_commit            | 1                       |
  37. | innodb_flush_method                       |                         |
  38. | innodb_flush_nei**or_pages               | area                    |
  39. | innodb_force_load_corrupted               | OFF                     |
  40. | innodb_force_recovery                     | 0                       |
  41. | innodb_ibuf_accel_rate                    | 100                     |
  42. | innodb_ibuf_active_contract               | 1                       |
  43. | innodb_ibuf_max_size                      | 134201344               |
  44. | innodb_import_table_from_xtrabackup       | 0                       |
  45. | innodb_io_capacity                        | 200                     |
  46. | innodb_kill_idle_transaction              | 0                       |
  47. | innodb_large_prefix                       | OFF                     |
  48. | innodb_lazy_drop_table                    | 0                       |
  49. | innodb_lock_wait_timeout                  | 120                     |
  50. | innodb_locks_unsafe_for_binlog            | OFF                     |
  51. | innodb_log_block_size                     | 512                     |
  52. | innodb_log_buffer_size                    | 8388608                 |
  53. | innodb_log_file_size                      | 268435456               |
  54. | innodb_log_files_in_group                 | 3                       |
  55. | innodb_log_group_home_dir                 | ./                      |
  56. | innodb_max_dirty_pages_pct                | 90                      |
  57. | innodb_max_purge_lag                      | 0                       |
  58. | innodb_mirrored_log_groups                | 1                       |
  59. | innodb_old_blocks_pct                     | 37                      |
  60. | innodb_old_blocks_time                    | 0                       |
  61. | innodb_open_files                         | 300                     |
  62. | innodb_page_size                          | 16384                   |
  63. | innodb_purge_batch_size                   | 20                      |
  64. | innodb_purge_threads                      | 1                       |
  65. | innodb_random_read_ahead                  | OFF                     |
  66. | innodb_read_ahead                         | linear                  |
  67. | innodb_read_ahead_threshold               | 56                      |
  68. | innodb_read_io_threads                    | 8                       |
  69. | innodb_recovery_stats                     | OFF                     |
  70. | innodb_recovery_update_relay_log          | OFF                     |
  71. | innodb_replication_delay                  | 0                       |
  72. | innodb_rollback_on_timeout                | OFF                     |
  73. | innodb_rollback_segments                  | 128                     |
  74. | innodb_show_locks_held                    | 10                      |
  75. | innodb_show_verbose_locks                 | 0                       |
  76. | innodb_spin_wait_delay                    | 6                       |
  77. | innodb_stats_auto_update                  | 1                       |
  78. | innodb_stats_method                       | nulls_equal             |
  79. | innodb_stats_on_metadata                  | ON                      |
  80. | innodb_stats_sample_pages                 | 8                       |
  81. | innodb_stats_update_need_lock             | 1                       |
  82. | innodb_strict_mode                        | OFF                     |
  83. | innodb_support_xa                         | ON                      |
  84. | innodb_sync_spin_loops                    | 30                      |
  85. | innodb_table_locks                        | ON                      |
  86. | innodb_thread_concurrency                 | 16                      |
  87. | innodb_thread_concurrency_timer_based     | OFF                     |
  88. | innodb_thread_sleep_delay                 | 10000                   |
  89. | innodb_use_global_flush_log_at_trx_commit | ON                      |
  90. | innodb_use_native_aio                     | ON                      |
  91. | innodb_use_sys_malloc                     | ON                      |
  92. | innodb_use_sys_stats_table                | OFF                     |
  93. | innodb_version                            | 1.1.8-26.0              |
  94. | innodb_write_io_threads                   | 8                       |
  95. +-------------------------------------------+-------------------------+
  96. 90 rows in set (0.00 sec)
复制代码
平时200M左右内存,高峰时候大概300~500M左右。
作者: star826    时间: 2013-1-2 20:57
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/) Powered by Discuz! X3.4