• 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 178 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 (24.3K 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

  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023

About This Article

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

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT