100% CPU Mysql + AGI/CDR

During heavy load of about 100 concurrent calls the CPU on one of our servers spikes to 100%. Running Top we see that Mysqld is 100%. This is probably due to at least two things we can think of: Mysql CDR addon and at the end of each call, during hangup, we insert a record into another DB using an AGI script. The AGI script opens a new connection to Mysql, inserts one row and disconnects. We are using mysql_pconnect and it looks like the CDR is also using pconnect, so persistent connections are being used in both cases. Not sure where else to look. Any ideas?

Thanks.

Hi, Agi’s will add load as well as the mysql. have a read of cyber-cottage.co.uk/site/index.p … &Itemid=31 I go into a little detail about Agi’s and load

Ian