Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.5
Component:
General
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2007 at 10:21 UTC
Updated:
10 Sep 2008 at 01:44 UTC
Hi,
As traffic increased on our client site, the server started consuming huge amounts of RAM. It's constantly hitting 80%+. This then leads to a database crash!
I've analysed all the logs, so please find my analysis and possible solution below. I think it's related to the CCK module.
1) Scanning the DB server logs, it's showing the following:
#The number of requests to read a row based on a fixed position. This is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan whole tables or you have joins that don't use keys properly.
Handler_read_rnd 12 k
#The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
Handler_read_rnd_next 17 M
This led me to believe one of the module tables is lacking an index. So I began my search!
2) I've identified the the tables produced via the CCK module. They all seem to be lacking an index on nid.
I'm interested in hearing your thoughts on this.
Comments
Comment #1
dalinI'm guessing that nid should indeed be indexed (we'll really need some benchmarks for this). In addition I think that any nodereference fields should be indexed since they are in essence foreign keys.
Comment #2
robertdouglass commentedWe added indexes to our nodereference foreign keys. Agree that this should be done at CCK level.
Comment #3
moshe weitzman commented#241078: Reverse node-reference views relationship