How to optimize Wowza server for Peer5

If don't already have a running Wowza server please follow one of the following guides:

*This guide assumes HLS, DASH integration is performed in a similar fashion.

In order for end-users to efficiently transmit segments a few configuration changes are required. The default number of segments, the segment length and the number of chunks can improve overall user experience and peer-to-peer performance.

The default Wowza HLS configuration value is to return 3 segments in each playlist - each 10 seconds long.
We’d like to configure it to 20 segments, 5 seconds long each instead.
We will also add CORS. This can be done either from the UI or by editing the XML.

Option 1: From the Wowza UI

a. playlist length
Under your live application > Properties > Cupertino stream packetizer
set cupertinoPlaylistChunkCount to 20

b. segment sizes
Under your live application > Properties > Cupertino stream packetizer
set cupertinoChunkDurationTarget to 5000

c. number of stored chunks
Under your live application > Properties > Cupertino stream packetizer
set cupertinoMaxChunkCount to 30

c. CORS Under your live application > Properties > Custom > Edit > Add Customer Property:
set Path to /Root/Application/HTTPStreamer
set Name to cupertinoUserHTTPHeaders
set Type to String
set Value to ACCESS-CONTROL-ALLOW-ORIGIN:*|ACCESS-CONTROL-EXPOSE-HEADERS:content-length

Option 2: Application.xml

It is also possible to set these values Directly in the application configuration file located at /conf//Application.xml
* Make sure to backup the configuration file in case anything goes wrong

Open the file with a text editor, In the XML under Root/Application/LiveStreamPacketizer/Properties add the following properties:

<Property>
    <Name>cupertinoChunkDurationTarget</Name>
    <Value>5000</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoPlaylistChunkCount</Name>
    <Value>30</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoMaxChunkCount</Name>
    <Value>30</Value>
    <Type>Integer</Type>
</Property>

Under Root/Application/HTTPStreamer/Properties add the following property:

<Property>
    <Name>cupertinoUserHTTPHeaders</Name>
    <Value>ACCESS-CONTROL-ALLOW-ORIGIN:*|ACCESS-CONTROL-EXPOSE-HEADERS:content-length</Value>
    <Type>String</Type>
</Property>