Server knocked offline by mass "SELECT * FROM cdr WHERE..."

One of my servers was knocked offline today by hundreds of SELECT * from cdr statements in the following format:

SELECT * FROM cdr WHERE NOT(recordingfile = '') AND (uniqueid = '1697491598.213817' OR linkedid = '1697491598.213817') LIMIT 1

It basically hanged the phone server because incoming/outgoing calls couldn’t log data to the CDR table.

Doing a killall -SIGKILL httpd stopped new queries from coming in and allowed the backlog of queries to drain. If I start httpd back up, the queries start mounting.

Any idea what might be causing it? I’m sorta leaning towards Zulu because there are a ton of zulu queries in the logs at the same time.

Also, as a side note, why in the hell aren’t there any indexes on cdr and cel for things like eventtime, calldate, or other commonly queried fields?

Seems like a huge mistake…

EDIT: Looking at /usr/src/freepbx-sql- shows indexes being created…hmm…now why doesn’t my remote CDR database suddenly have them?


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.