Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to add a bit of memory to MySQL on a Linode VPS server on which I've got a small facebook (canvas app) PHP app using MySQL running. I'm not super familiar with MySQL optimization so I'm hoping to find a simple answer. I think I want to increase the key_buffer size (the default is 16M) to something like 32M to start, but I'm not sure if I need to tweak anything else as well. All I've done so far is increase the query_cache_size to 32M from 16M.

There's also key_buffer under [mysqld] and key_buffer under [isamchk]. What are the difference between those two?

If I have Linode 2048MB ( VPS, what would recommend I set the buffers to? I don't expect this site to have tons of visitors, but I'd like it to be as optimized as possible. Definitely way more heavy on the database access than PHP and very few HTTP requests.

share|improve this question
MyISAM or InnoDB? – Ben Jencks Nov 24 '10 at 2:45
@Ben Jencks MyISAM – typeoneerror Nov 24 '10 at 4:59

You should learn about related variables from SHOW GLOBAL STATUS output. They will tell you if any of caches needs to be increased. Increase them as log as it is effective (but don't set query_cache_size bigger than 128M, there is bug related to big query caches)

[mysqld] section is for mysqld process (i.e. for the server), [isamchk] for myisam maintanence utility. (So you need [mysqld] to change server parameters)

share|improve this answer

I think I want to increase the key_buffer size

Why do you think that?

Go get a copy of mysqltuner - its very good at identifying bottlenecks, although out-of-the box mysql tends to be very well behaved.

share|improve this answer
Why: I donno. Haha. I guess I was thinking I had a lot of memory to play with for a small application and wanted to give MySQL more love since the app is higher on DB load. Thanks for the recommendation. will check it out. – typeoneerror Nov 24 '10 at 19:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.