• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Optimizing MySQL Database Performance : Editing my.cnf Settings

By Abhishek Ghosh April 17, 2014 6:40 am Updated on April 17, 2014

Optimizing MySQL Database Performance : Editing my.cnf Settings

Advertisement

Optimizing MySQL Database Performance Can be Done by Editing my.cnf File. By default, MySQL Server is configured for very low RAM server. Previously we wrote about how to Fix Sudden Error Establishing a Database Connection in WordPress. Actually, that was not truly only for WordPress, it will work for any CMS. That Fix works nice and is intended as a quick fix. After you are running the Server nicely, you must understand why MySQL Gone Away or Error Establishing a Database Connection are appearing. That is what we will do with Optimizing MySQL Database Performance by tuning its settings file named my.cnf. Also, you must optimize the PHP part in the way we have described in APC Configuration and Optimization for Rackspace Cloud Server (PVHVM).

 

Optimizing MySQL Database Performance : The Server Setup and Other Parts We Have Considered

 

 

We are taking that you are using PVHVM Virtualization Mode. We are assuming that you are running WordPress on a Single Performance Server on PVHVM mode in the way we described in the Full step by step guide to Install WordPress on Ubuntu 13.10 on Rackspace.

Location of my.cnf vary. You should run this command :

Advertisement

---

Vim
1
mysqld --help --verbose

It will give you an informative output like :

Vim
1
2
3
4
5
Default options are read from the following files in the given order:
/etc/my.cnf
/etc/mysql/my.cnf
/usr/etc/my.cnf
~/.my.cnf

You should consider – which is Global and Loads first in order. If ~/.my.cnf is Global and order is like above, you must have the same settings (copy one from another, you can use FTP if you feel uncomfortable). As MySQL is very important part of the setup, you must take a full image backup of the server plus backup of WordPress or the software you are running. In case you want to start Editing from /etc/my.cnf ; you must copy it to your computer for urgent and quick rescue.

query_cache_size is the size of cache as MySQL can cache the result set, avoiding the overhead of running through the data over and over.
key_buffer is the size of the buffer used with indexes. With a larger buffer, SQL command will finish faster. We keep one forth in numerical value of the physical RAM of the server for SQL server.

Optimizing MySQL Database Performance

We provided two examples of explanation, you must read the docs to learn about the others.

This is a standard settings for a 2GB server :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[mysqld]
local-infile=0
skip-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1
 
[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192
 
[mysqldump]
quick
max_allowed_packet=16M
 
[mysql]
no-auto-rehash
#safe-updates
 
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 
[mysqlhotcopy]
interactive-timeout

You should change one by one (or add if does not exist), restart mysql server to check if fronted is going fine (else comment out or change the last thing…simple) and finally restart the whole server ( reboot is the command ) after stopping it :

Vim
1
2
3
4
5
sudo /etc/init.d/mysql stop
#or
service mysqld stop
#or
sudo stop mysql

Obviously, if you replace the word stop with restart or start, the desired easy to understand function will take place.

DO NOT try to optimize MySQL in Rackspace Deployment. They are fully optimized. There is a Perl script for MySQL Tuning, do not use it for PVHVM unless you are a database Guru.

Tagged With MySQL , wordpress mysql optimization my cnf , wordpress mysql optimization my cnf language:en , paperuri:(3ef80c54f46f5694eedd6bb126ad8c8b) , optimizing mysql windows , optimize mysql windows 10 , optimize mysql performance windows , optimize my cnf settings , mysql optimize server settings , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1836 fZTeKEd37fuj-yHakY7wL2zZal_5S7nAR03TYuEeqdO4KWyLI1wtxCBLQqPkX4KQ 8f2b98e9db0664939091a041bf381e31273c5846&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme

This Article Has Been Shared 819 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Optimizing MySQL Database Performance : Editing my.cnf Settings

  • WordPress 3.6 on Rackspace Cloud Sites and W3 Total Cache 0.9.3 Plugin

    WordPress 3.6 on Rackspace Cloud Sites and W3 Total Cache 0.9.3 Plugin with perfect configuration demands quite good idea on many aspects,here are some for you.

  • Business Intelligence Software in Healthcare

    Increased desire for more and better information by different industries resulted in increased sales of BI software solutions including Healthcare.

  • Photo Gallery Hosting : Free or Nearly Free Practical Options

    Photo gallery hosting can be Free or nearly Free with various Cloud based and Free Softwares. It is possible to run a website that has your photos with no cost.

  • Cloud Computing and Actions Against Hackers

    Cloud Computing IT executives at least theoretically now know about “distributed denial of service” attacks. Sales and destruction of brand image annoys the users.

  • OpenShift Node.js Tutorial with Video

    OpenShift Node.js Tutorial with Video is an excellent guide for anyone! You can create your own instance of Node.js Application within few minutes.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • The Future Of Serverless: The Load-Intensive Workload Case May 25, 2022
  • Cutting Out The Coding: Serverless Computing In Action May 24, 2022
  • Types of Blackjack Variants: Discover the Different Versions of the Game May 23, 2022
  • How Cloud, Robotics And Sensor Technologies Are Changing The Business Landscape May 23, 2022
  • Modernizing Your Business With a Hybrid Cloud Strategy May 22, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Optimizing MySQL Database Performance : Editing my.cnf Settings," in The Customize Windows, April 17, 2014, May 25, 2022, https://thecustomizewindows.com/2014/04/optimizing-mysql-database-performance-editing-cnf-settings/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy