<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
The sleep's done each time the directory's empty, not each time a
file's written.&nbsp; File open and close<br>
are trivial (it's probably still cached), and the contents are going to
have to be parsed wherever you <br>
process it.<br>
<br>
We've used exactly this to process deliver CDRs on boxes handling in
excess of 500K mins/day<br>
without issue.&nbsp; And, looking at one now, the CDR processor's used about
4% of the CPU time<br>
of FreeSWITCH, and about half that of the MySQL database which it
writes the records to, also<br>
on the local machine, from which they're simply copied to the main CDR
processor.<br>
<br>
It performance simply isn't worth worrying about.<br>
<br>
--Dave<br>
<blockquote cite="mid:49098CCE.7080500@kinetix.gr" type="cite">
  <pre wrap="">"sleep for a couple of seconds"

But then you could only insert 1800 cdrs per hour...
If I was to insert 36000 cdrs per hour this means that I have to
open
parse
close
10 files per second. Imagine the I/O penalty just for opening - closing the file.
(the persing is the same for both situations)

  </pre>
  <br>
  <br>
David Knell wrote:
  <blockquote cite="mid:49094B5E.3070203@3c.co.uk" type="cite">
    <pre wrap=""><a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:regs@kinetix.gr">regs@kinetix.gr</a> wrote:
  </pre>
    <blockquote type="cite">
      <pre wrap="">Yes, the xml files give you tons of info... but isn't it a little 
insufficient - performance wise -
to open and close so many files in such a little time. In a PBX 
environment that wouldn't be an
issue but if we get to the small-voip-carrier level (some thousand cdrs 
per hour)
that could slow things down considerably, wouldn't it?
  
    </pre>
    </blockquote>
    <pre wrap=""><!---->Not that you'd notice.  We run XML CDR to database scripting on each box 
that we use
for switching, and it's a pretty trivial task compared with switching 
all that media.  Doing it
this way is:-
(a) distributed - one process per box scales nicely;
(b) robust - script down, DB down, no problem: files just queue up;
(c) simple - the script logic is trivial:
- while 1
  - for each file in the XML CDR directory
    - open it
    - parse it (XML::Simple for us)
    - insert it in to the DB
    - delete it
  - sleep for a couple of seconds
Two error cases: can't parse or can't find data which should be there: 
move the file in to
another directory to be examined by real eyes; DB insert fails: break 
out of inner loop and
it'll be retried after a short pause.

--Dave

  </pre>
  </blockquote>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Freeswitch-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
David Knell, Director, 3C Limited
T: 020 8114 8901  F: 020 3002 7257  M: 001 415 630 3031
<a class="moz-txt-link-freetext" href="http://www.3c.co.uk">http://www.3c.co.uk</a> </pre>
</body>
</html>