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

dalin’s picture

I'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.

robertdouglass’s picture

We added indexes to our nodereference foreign keys. Agree that this should be done at CCK level.

moshe weitzman’s picture

Status: Active » Closed (duplicate)