MySQL Is Slow in Magento
- 1). Install an opcode cache for PHP on your server. Magento recommends APC or XCache. Log in to your server via the secure shell (SSH) and then type "wget" followed by the URL to the application's package. Extract the package using the "tar xzvf packagename.tar.gz" (without quotes). Open the package directory, then issue the following three commands in order to install:
./configure
make
make install - 2). Enable KeepAlives on Apache. With the secure shell still open, type "vi /etc/conf/httpd.conf" and press "Enter" to open the Apache configuration file. Scroll through to the "KeepAlive" tag and ensure it reads "KeepAlive On" and not "KeepAlive Off." Press "Esc," then type ":x" to exit and save changes.
- 3). Type "vi /etc/my.cnf" and press "Enter" to open the MySQL configuration. If your Web server has more than 1GB of memory, then you can increase the values in this file. Set the "key_buffer" to roughly half of the memory on your server, then increase the above values in the same proportion. Press "Esc," then ":x" to exit and save.