Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Rotating CDR records inside mysql - anyone


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
atis at iq-labs.net
Guest





PostPosted: Tue Jan 22, 2008 3:38 pm    Post subject: [asterisk-users] Rotating CDR records inside mysql - anyone Reply with quote

On 1/22/08, tloginbr-asterisk at yahoo.com.br
<tloginbr-asterisk at yahoo.com.br> wrote:
Quote:
Hi everyone,

I have a few asterisk machines doing PSTN calls, and I keep track of
all cdr in a single machine running mysql 5. Since I have a very
large amount of records in there, its getting pretty slow to query
the database, so I'm wondering if anyone does some type of log
rotating, like save the data for a single month inside a separate
table and do that every month, so I keep the tables small enough to
build my reports. I know this is mainly a mysql question, but maybe
someone here has some stored procedures that do this already...

Well, i wouldn't recommend delete, as that would keep mysql very
unhappy. you could do RENAME TABLE and CREATE TABLE, or mysqldump and
TRUNCATE TABLE, but they have to happen almost instantly (without
asterisk trying to do INSERT). I have nearly none experience with
transactions, but probably those would be helpful.

Btw, you can block access to mysql by firewall (to move existing data)
or stop mysql (to physycally copy binary database files) and then take
it back up - asterisk will post it's CDRs later when db comes
accessible.
Btw - how many records do you have that it gets slow? On what machine?

I currently have 3 million CDR records in MySQL with well created
indexes - and most reports are dynamic. Usually from 0 to 2 seconds,
but sometimes up to minute for joins :p. Well, that's 2x Quad core
xeons of 3GHz and 8Gb RAM (2 of which are used by MySQL indexes).
Asterisk is running on same machine.

Regards,
Atis


--
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services