节省云服务器(VPS)的内存

栏目: 服务器 · 发布时间: 8年前

内容简介:节省云服务器(VPS)的内存

大家一般都买个 vps 来放个主人主页、公司官网什么的,内存一般都不大,比如 1GB 什么的。估计总是发现装完 LAMP 就基本上内存全用光了。

在这里分享两个小 tips.

mysql

my.conf 中加入以下配置,关掉性能优化。嗯,反正官网一天也来不了几十个UV,关了没点问题。

[mysqld]
performance_schema=off

这样能节省三四百兆内存。

apache

apache 会预启动几条进程,也要占用一些内存,我们可以调小点数量。在 apache2.conf 尾部加入以下配置:

<IfModule mpm_prefork_module>
    StartServers          1
    MinSpareServers       1
    MaxSpareServers       3
    MaxClients           10
    MaxRequestsPerChild 3000
</IfModule>

<IfModule mpm_worker_module>
    StartServers          1
    MinSpareThreads       5
    MaxSpareThreads      15 
    ThreadLimit          25
    ThreadsPerChild       5
    MaxClients           25
    MaxRequestsPerChild 200
</IfModule>

也能省下来不少内存。


以上所述就是小编给大家介绍的《节省云服务器(VPS)的内存》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Getting Started with C++ Audio Programming for Game Development

Getting Started with C++ Audio Programming for Game Development

David Gouveia

Written specifically to help C++ developers add audio to their games from scratch, this book gives a clear introduction to the concepts and practical application of audio programming using the FMOD li......一起来看看 《Getting Started with C++ Audio Programming for Game Development》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具