I think many friends, like me, can't resist the temptation of low prices and start small memory VPS 。 However, the side effect of low price is low speed, which is inevitable (if you have a choice of low price and high quality, you can share~). Today I will talk about the simple optimization of small memory VPS. Of course, the premise of the discussion is that you install KLOXO Panel. If you select the LNMP installation package, you don't need to look down.
[Optimization I] MySQL optimization
Optimization method:
First enter the/etc directory and edit my.cnf
Command: cd/etc first, then vi my.cnf
Add the following three lines under [mysqld]:
skip-locking
skip-bdb
skip-innodb
Restart MYSQL after saving
Command:/sbin/service mysqld restart
Now use top to see if the memory usage has dropped below 100M?
Function details:
Use the MySQL option of – skip locking to avoid external locking
Load the – skip bdb – skip innodb parameter to avoid memory waste
[Optimization II] Switch Site Programs
Optimization method:
You can see the following two pictures, which are the screenshots before and after switching website programs. The effect of switching to lighttpd is also immediate.
Others There are other optimizations that can also reduce memory consumption. For example, do not load modules that are not required by Apache, and manually modify httpd.conf; There are also djbdns of dns and bogofilter of spam. If they are not needed, they can be directly turned off in the service; There are also some things that are not needed very much: imap, qmail, iptables, etc. If all of them are turned off, it is estimated that the memory can be reduced to about 50.
[Postscript] In fact, these optimization methods I mentioned are only superficial, and the experts can only smile without saying anything. However, the effect of this operation is really obvious. As for the VPS I used in the above figure, 128MB of memory is basically consumed by one KLOXO without optimization. Therefore, optimization is necessary.
Statement: Blogs are only for sharing information and are not recommendations. Websites do not participate in transactions and are not intermediaries. The content only represents personal views and is not authoritative. Readers should consider it and take their own risks! Every penny and every commodity is still the eternal truth. Juvenile readers (including physical and psychological) should visit this website with their guardians! This article is written by( Zhao Rong )Original compilation, reprint, please keep the link: Small memory VPS installation KLOXO simple optimization The code is not easy, please do not copy or paste! About using: This website mainly shares server and VPS information, and does not provide any product sales or purchase. All visitors please purchase and use products within the scope of national laws and regulations. QQ group discussion: 683851361 About safety: Any IDC has the possibility of going bankrupt and running away. The host line is even more uncontrollable. Monthly payment and backup are your best choices. Please keep good and regular backup habits