CastleCops, Internet Crime Fighters
Need help? Click here to register for free! Absolutely zero advertisements on this site!

$9736.22 of $21422.68
left sidedonated so farneed $11686.46 donated to reach our goalright side, our goal
Help CastleCops serve the community on new servers, Donate Here to reach our goal.

Donation/Premium
spacer
block bottom
Security Central
spacer
· Home
· PIRT/Fried Phish
· MIRT
· SIRT
· Deutsch
· Wiki
· Newsletter
· O16/ActiveX
· CLSID List
· Contest2007
· Downloads
· Feedback (send)
· Forums
· HijackThis
· Hijacktrend
· LSPs
· My Downloads
· O18
· O20
· O21
· O22
· O23
· O9
· Premium
· Private Messages
· Proxomitron
· Reviews
· Search
· StartupList
· Stories Archive
· Submit News
· WsIRT
· Your Account
· Acceptable Use Policy
block bottom
Survey
spacer
Was 2007 a good year?

Yes it was a wonderful year
Yes, but there is always room for improvement
Status quo
It was a challenge
Other (leave comment)



Results
Polls

Votes: 949
Comments: 28
block bottom
spacer spacer

MySQL query_cache_size improvements

 
Post new topic   Reply to topic       All -> FavForums -> perf [del.icio.us!] [digg it!] [reddit!]
View previous topic :: View next topic  
Author Message
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27351

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Wed Feb 20, 2008 3:04 pm    Post subject: MySQL query_cache_size improvements
Reply with quote

[OK] Query cache efficiency: 74.9%
[!!] Query cache prunes per day: 337315

With an uptime of about eleven hours, so I know its not much. But, I've never truly had much success with those low_mem_prunes.

Code:
mysql> show global variables like 'query%';
+------------------------------+-----------+
| Variable_name                | Value     |
+------------------------------+-----------+
| query_alloc_block_size       | 16384     |
| query_cache_limit            | 2097152   |
| query_cache_min_res_unit     | 1024      |
| query_cache_size             | 104857600 |
| query_cache_type             | ON        |
| query_cache_wlock_invalidate | OFF       |
| query_prealloc_size          | 8192      |
+------------------------------+-----------+
7 rows in set (0.00 sec)


Suggestions appreciated.

8 GB RAM.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Trpm

Security Expert
Premium Member

Joined: Jan 16, 2004
Posts: 1663

Premium

PostPosted: Wed Feb 20, 2008 10:35 pm    Post subject:
Reply with quote

Have you tried increasing your allocation block size?
Rex


_________________
I'm a reasonable person just ask Eeyore or Christopher R.
image
Back to top
View users profile Send private message
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27351

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Thu Feb 21, 2008 12:09 am    Post subject:
Reply with quote

If there has been one thing which caused me confusion with mysqld, its query cache. I've attempted various values from 4k up to 32k and seem to get those darn lowmem prunes.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Bill_Bright

General
General
Premium Member

Joined: Jan 16, 2004
Posts: 8963
Location: Nebraska, USA
MVP Premium

PostPosted: Fri Feb 22, 2008 1:24 pm    Post subject:
Reply with quote

Ummm, possibly demonstrating my ignorance in this area, but I note the problems increasing the signature limit to 512 characters were thought to be related to MySQL - is there some extended/related corruption or incorrect setting that may be affecting more than one area?

Just tossing out what's bouncing around the chamber.


_________________
image Bill, AFE7Ret
Freedom is NOT Free!

image
Back to top
View users profile Send private message
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27351

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Fri Feb 22, 2008 1:40 pm    Post subject:
Reply with quote

I'll writeup a new exec sum today.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27351

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Sat Feb 23, 2008 8:22 pm    Post subject:
Reply with quote

After about 20 hours uptime on the mysql 5.0.x install on the other system, here is what mysqltuner.pl reports:

[OK] Query cache efficiency: 97.4%
[!!] Query cache prunes per day: 190560

How to bring that down is the question?

Taking the values of

Qcache_lowmem_prunes / Uptime =

2.2285

Not a good value.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Gena01

Trooper
Trooper


Joined: Jun 07, 2007
Posts: 14
Location: USA

PostPosted: Sat Feb 23, 2008 8:56 pm    Post subject:
Reply with quote

From this article: http://www.sqlmanager.net/en/articles/704

Another indicator of poor query reuse is an increasing Qcache_lowmem_prunes value. This indicates how often MySQL had to remove queries from the cache to make use for incoming statements. Other reasons for an increasing number of Qcache_lowmem_prunes are an undersized cache, which can't hold the needed amount of SQL statements and result sets, and memory fragmentation in the cache which may be alleviated by issuing a FLUSH QUERY CACHE statement. You can remove all queries from the cache with the RESET QUERY CACHE command.

Another article that explains some of the parameters: http://www.quest-pipelines.com/newsletter-v6/1205_B.htm

Good luck,

Gena01

Back to top
View users profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       All -> FavForums -> perf All times are GMT
Page 1 of 1

 
Quick Reply:
Username: 

Quote the last message
Attach signature (signatures can be changed in profile)
 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001 phpBB Group
spacer spacer