减少ubuntu @ aws微型实例上mysql的内存消耗 [英] Reducing memory consumption of mysql on ubuntu@aws micro instance

查看:93
本文介绍了减少ubuntu @ aws微型实例上mysql的内存消耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始了PoC项目,我们正在开发一个小型Web应用程序.初始设置是在AWS的微型实例上完成的.我们正在使用Rails + mysql堆栈.

I have recently started on a PoC project wherein we are developing a small web app. The initial setup is done on a micro instance from AWS. We are on rails+mysql stack.

在安装/运行MySQL之后,我发现已经消耗了大约500+ MB的RAM.其余的系统(微型实例仅有620 MB的RAM)留给其他人.

After installing/running MySQL, I see that about 500+ MB RAM has been consumed already; leaving quite less for rest of the systems (micro instances have barely 620 MB RAM).

我们的应用程序在此阶段非常简单.我可以做些减少MySQL服务器消耗的内存的事情吗?

Our app is fairly simple at this stage. Can I do something to reduce the memory consumed by MySQL server?

感谢帮助.

推荐答案

在MySQL配置文件(my.cnf)中更改此设置

Change this setting in the MySQL configuration file (my.cnf)

key_buffer              = 8M 
max_connections         = 30 # Limit connections
query_cache_size        = 8M # try 4m if not enough 
query_cache_limit       = 512K
thread_stack            = 128K

这篇关于减少ubuntu @ aws微型实例上mysql的内存消耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆