• 公告栏使用li标签,同时你可以使用FontAwesome以及其他HTML语法
  • FontAwesome示例
  • 价值投资不能保证我们盈利, 但价值投资给我们提供了通向成功的唯一机会@巴菲特

Optimize Apache and MySQL for a 256MB VPS

菜鸟Linux笔记 shaobo 78次浏览 1041字 0个评论

sudo nano /etc/mysql/my.cnf

 

Add the following line into the section [mysqld]:

skip-innodb

 

Next locate the line skip-external-locking and add skip-locking below that line.

 

Now find the section labeled “Fine Tuning”. Change/add the settings in that section to match those below:

 

key_buffer = 16K

max_allowed_packet = 1M

thread_stack = 64K

thread_cache_size = 4

sort_buffer = 64K

net_buffer_length = 2K

 

Save the file (ctrl+x) and restart MySQL: sudo /etc/init.d/mysql restart

If you run MySQLtuner again you will see that the “memory” warning is gone, ignore the aother warnings for the moment (you need to run the script after a few days again to get exact test results)

 

Optimize Apache in prefork mode

If you followed the Ubuntu tutorial we’ve mentioned in the first paragraph, your Apache setup should run in prefork mode. The default settings are much to high, open the file sudo nano /etc/apache2/apache2.conf andchange the following settings:

 

 

Timeout 45

KeepAlive On

MaxKeepAliveRequests 200

KeepAliveTimeout 3

 

StartServers 5

MinSpareServers 5

MaxSpareServers 10

MaxClients 30

MaxRequestsPerChild 2000

 

That’s all, restart Apache using sudo /etc/init.d/apache2 restart. If you know more tweaks, please share.


喜欢 (0)

您必须 登录 才能发表评论!