Turn on MySQL query cache to speed up query performance?
Many times developers looking for ways to speed up query, in mysql we can enable query cache to speed up query performance. Whenever query cache is enable, it will cache the query in memory and boost query performance.
As we know, speed is always the most important element in developing a website especially for those high traffic database driven website. You can try to turn on query cache to speed up query.
To speed up query, enable the MySQL query cache, before that you need to set few variables in mysql configuration file (usually is /etc/my.cnf or my.ini)
- 1st, set query_cache_type to 1. (There are 3 possible settings: 0 (disable / off), 1 (enable / on) and 2 (on demand).
query-cache-type = 1
Read more…
System Tuning Info for Linux Servers
NOTE: Most of the info on this page is about 3 years, and one or two kernel versions out of date.
This page is about optimizing and tuning Linux based systems for server oriented tasks. Most of the info presented here I’ve used myself, and have found it to be beneficial. I’ve tried to avoid the well tread ground (hdparm, turning off hostname lookups in apache, etc) as that info is easy to find elsewhere.
Some cases where you might want to apply some of benchmarking, high traffic web sites, or in case of any load spike (say, a web transfered virus is pegging your servers with bogus requests)
Read more…
Speed up your system by avoiding the swap file
Most modern operating systems are capable of using a file or partition known as a swap or paging file. Most Linux distributions will also install one for you by default. This file is used to extend the amount of available RAM by writing some of it to your hard drive.
There’s just one problem: hard drives are slow. We can’t fix that problem yet, but we can avoid it. The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness. A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.
Read more…