[Home]

Summary:ASTERISK-11409: [patch] Simple file recording buffer - great performance gain
Reporter:Grzegorz Garlewicz (garlew)Labels:
Date Opened:2008-02-09 05:33:15.000-0600Date Closed:2008-04-03 02:45:08
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug-11962.diff
( 1) recording.patch
Description:By default there is no recording buffer in Asterisk. There were attempts to record  to RAM-disk etc. It turns out creating a simple 32K buffer for each recorded stream greatly increases number of files Asterisk can record simultaneously without RAM-disk. I'm not putting any numbers here because it depends on disk subsystem used.

Also recording to wav format unnecesarily calls update_header for every frame written - it is sufficient to update header when closing the stream.
Below is strace output for one frame wav write before the patch.
[pid 30797] write(26, "\344\343\1\0", 4) = 4
[pid 30797] write(26, "\300\343\1\0", 4) = 4
[pid 30797] write(26, "\30\0\10\0x\0\330\377\370\3778\0\270\377\30\0\350\377\230"..., 320) = 320
Comments:By: Tilghman Lesher (tilghman) 2008-04-02 13:41:39

As this is a new feature, the patch needs to be updated to apply against trunk.  As soon as that is done, this can go in.

By: snuffy (snuffy) 2008-04-02 17:30:44

I have updated this to trunk

By: Digium Subversion (svnbot) 2008-04-03 02:44:23

Repository: asterisk
Revision: 112564

U   trunk/formats/format_wav.c
U   trunk/include/asterisk/mod_format.h
U   trunk/main/file.c

------------------------------------------------------------------------
r112564 | tilghman | 2008-04-03 02:44:17 -0500 (Thu, 03 Apr 2008) | 7 lines

Use a 32k file buffer on recordings, which increases the efficiency of file recording.
(closes issue ASTERISK-11409)
Reported by: garlew
Patches:
      recording.patch uploaded by garlew (license 376)
      bug-11962.diff uploaded by snuffy (license 35)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=112564

By: Digium Subversion (svnbot) 2008-04-03 02:45:08

Repository: asterisk
Revision: 112565

_U  branches/1.6.0/

------------------------------------------------------------------------
r112565 | tilghman | 2008-04-03 02:45:05 -0500 (Thu, 03 Apr 2008) | 14 lines

Blocked revisions 112564 via svnmerge

........
r112564 | tilghman | 2008-04-03 02:49:05 -0500 (Thu, 03 Apr 2008) | 7 lines

Use a 32k file buffer on recordings, which increases the efficiency of file recording.
(closes issue ASTERISK-11409)
Reported by: garlew
Patches:
      recording.patch uploaded by garlew (license 376)
      bug-11962.diff uploaded by snuffy (license 35)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=112565