Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speeding up MySQL

Status
Not open for further replies.

ScottA

Technical User
Jul 10, 2000
21
0
0
US
Hello All:<br><br>I'm running Linux with MySQL on a web server.<br><br>We get around 50k - 100k hits per day and my database is starting to look a bit slow during peak times.<br><br>Any suggestions on how to speed it up?&nbsp;&nbsp;Especially INSERTS.<br><br>Scott
 
What version of MySQL are you using, and what is your server-side scripting language?
 
Mysql 3.20.32a<br><br>Perl 5.xxxx<br><br>
 
I would first suggest upgrading to the latest stable version: 3.22.32. You might even consider getting the latest beta; 3.23.22, because it has a few performance enhancements, as well as extra functionality.<br><br>However, I think your biggest bottleneck is Perl. Traditionally, Perl/CGI has to start up a new process for every web page hit that uses it. I'm not the greatest Perl guru, so I won't begin to tell you how to optimize it, but I believe FastCGI would help.<br><br>I recommend, though, considering PHP4 for your MySQL connections. Since it's not an all-purpose behemoth like Perl (That's a compliment), it has a few web content optimization tricks: persistent DB connections, compile-then-run operation, and with the addition of the Zend Optimizer, it beats just about anything out there.<br><br>I think you are right, though, that MySQL suffers a bit in the INSERT area, especially for complicated ones. As I recall from the benchmarks I've seen, nothing beats MySQL for raw output of data, which is great for web content, but PostgreSQL has more efficient handling of multiple INSERTS and UPDATES.<br><br>Other than that, though, there are several things you can do to speed up MySQL. If you are not using myisamchk, you need to start. And here is a page that can help you more than I can:<br><br><A HREF=" TARGET="_new">
 
Thanks for the info.&nbsp;&nbsp;I'm working on figuring out how to safely do the MySQL upgrade and try to optimize the code by possibly compiling it.&nbsp;&nbsp;I'll look in to PHP.<br><br>Thanks,<br>Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top