Feedback

Close

Cancel

Already a member?  Login
Recent Stories
1
Votes

While trying to optimize a MySQL query, I ran into a problems trying to avoid MySQL and disk caching which was making it impossible to accurately benchmark two different queries. Fortunately, I was running MySQL on a Centos box and this enabled me to run two quick commands that provided a "fresh" enviornment for each query benchmark.

echo 3 > /proc/sys/vm/drop_caches
service mysql restart

The first command clears the disk cache. The second restarts MySQL. Now, each query can be evaluated on its merits and not how well MySQL and Centos try to optimize performance.

Sunday, September 20, 2009 @ 6:17 pm   1830 Views   CoderTakeoutGuy   Like
Site © Copyright 2007-2012, BubbleLife Media LLC Privacy Policy Terms of Use
Sunday, February 05, 2012 11:10 PM
Powered by BubbleCommunities 0.10.4413.27815.64
BUBBLELIFE® is a registered trademark and BUBBLELIFE MEDIA™, BUBBLECOMMUNITIES™ and NEIGHBORHOOD BRANDS™ are trademarks of BubbleLife Media LLC. Unauthorized use is prohibited.