php forum
php mysql forum
php mysql smarty
 
Topic Options
#257937 - 08/31/03 09:58 PM Let's tune MySQL part II
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan

   Let Add to del.icio.us
  Digg Let Digg it
Ok, if you have followed the other thread about tuning MySQL, you are off to a great start! But I wanted to inform you of a few settings that after extensive testing has increased MySQL and overall server performance by over 50% <br /> <br />I have tested nearly every combination of my.cnf settings you can think of, and after reading more and more MySQL documentation I have found a few changes to make for those busy .threads sites with servers with 1 GB of ram or more run even faster. <br /> <br />If you have less RAM than 1GB, you may want to stick to the other settings I gave, but if you have 1GB+, this should help tremendously. <br /> <br />These are the settings you should have in your my.cnf file <br /> <br />
Code:
 <br />key_buffer=64M <br />table_cache=1024 <br />sort_buffer=4M <br />read_buffer_size=2M <br />
<br /> <br />These are the most important settings, and by giving them even more memory to work with, you should see your page load times increase dramaticaly as well as lower server loads. <br /> <br />One thing you may want to experiment with is the table_cache, it may work slightly better to run that at 512, but from my tests 1024 works great on a P4 server with 1 GB of ram and running a threads site with 50-90 users online and over 1200 posts per day. <br /> <br />So if you are still experiencing some slow loads and your server has some extra memory, this could easily help boost performance even a bit more <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#257938 - 09/09/03 12:29 PM Re: Let's tune MySQL part II [Re: palmen]
indy Offline
Newbie

Registered: 04/20/03
Posts: 10
Loc: Plauen, Germany
Another possibility helps MySQL running faster is to increase the size of the join buffer.<br /><br />So long...<br /><br />Indy
_________________________
-----
MySQL Cache Miss Rate: 0.0001 - that's it!

[]http://www.gnom.de/fun/barak_jones.gif[/]

Top
#257939 - 10/14/03 08:06 AM Re: Let's tune MySQL part II [Re: crablouse]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
I have two section that refer to the key_buffer: mysqld and myisamchk.<br /><br />In mysqld I have key_buffer set to 384M, is this excessive for a machine with 2GB of RAM (dual Xeon processors?)? In the myisamchk its set to 256M, again, excessive?
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#257940 - 10/14/03 11:09 AM Re: Let's tune MySQL part II [Re: gailg]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
Well, myisamchk I believe is only used when repairing/optimizing tables, so the larger that value, the faster that process probably goes, so I don't think that is of much a concern. I haven't tested any different myisamchk values to be able to say for sure.<br /><br />As for key_buffer, that may be a little high, but it's hard to say depending on where the rest of your memory is being used throughout the system. I personally use 64MB and 128MB for some of my 1GB ram systems, and find that works fine. I have not experimented with much higher values.<br /><br />You may want to run a few comparisons, starting with 128M, checking server load, memory usage, and the mysql footprint, run a few intense queries and average the time. Then try 256M... do the same thing.. and again your current value, just to get a better idea as to what your system likes best.

Top
#257941 - 03/23/04 05:52 PM Re: Let's tune MySQL part II [Re: palmen]
coloradok5 Offline
Enthusiast

Registered: 07/11/01
Posts: 462
Loc: Colorado
[]Jeremy said:<br />Ok, if you have followed the other thread about tuning MySQL, you are off to a great start! But I wanted to inform you of a few settings that after extensive testing has increased MySQL and overall server performance by over 50%<br /><br />I have tested nearly every combination of my.cnf settings you can think of, and after reading more and more MySQL documentation I have found a few changes to make for those busy .threads sites with servers with 1 GB of ram or more run even faster.<br /><br />If you have less RAM than 1GB, you may want to stick to the other settings I gave, but if you have 1GB+, this should help tremendously.<br /><br />These are the settings you should have in your my.cnf file<br /><br />
Code:
<br />key_buffer=64M<br />table_cache=1024<br />sort_buffer=4M<br />read_buffer_size=2M<br />
<br /><br />These are the most important settings, and by giving them even more memory to work with, you should see your page load times increase dramaticaly as well as lower server loads.<br /><br />One thing you may want to experiment with is the table_cache, it may work slightly better to run that at 512, but from my tests 1024 works great on a P4 server with 1 GB of ram and running a threads site with 50-90 users online and over 1200 posts per day.<br /><br />So if you are still experiencing some slow loads and your server has some extra memory, this could easily help boost performance even a bit more <img src="/forum/images/graemlins/smile.gif" alt="" /> [/]<br /><br />Jeremy<br />What did you use for max_connections?

Top
#257942 - 03/24/04 10:42 AM Re: Let's tune MySQL part II [Re: bisbell]
little_joe Offline
Member

Registered: 10/31/01
Posts: 209
Loc: Cleveland, Ohio
FWIW with peak users of 250, regularly at 150 users online, plus hundreds more hitting our non-forum pages and another application (phpAdsNew - serving ads on eveyr page we deliver) hitting MySQL, our max connections to MySQL from extended-status is 79. I set our max connections in my.cnf to 150, and we're nowhere near that limit. The default is 100.

Top


Who's Online
1 Registered (blaaskaak), 29 Guests and 5 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by AllenAyres
10/07/08 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
AllenAyres 11
blaaskaak 7
FREAK1 5
Chris Bale 4
Ian_W 4
tackaberry 4
Gizmo 4

 

 

 
fusionbb message board php hacks