Results 1 to 3 of 3

Thread: Java cpu 300 - 400%

  1. #1
    Join Date
    Sep 2014
    Posts
    2

    Question Java cpu 300 - 400%

    I use Wowza 2.2.4
    Core i5
    8 GB Ram
    CentOS

    Wowza is using JAVA CPU 300 - 400%



    VHost.xml
    <Root>
    <VHost>
    <HostPortList>
    <HostPort>
    <ProcessorCount>8</ProcessorCount>
    <IpAddress>*</IpAddress>
    <!-- Separate multiple ports with commas -->
    <!-- 80: HTTP, RTMPT -->
    <!-- 554: RTSP -->
    <Port>1935</Port>
    <SocketConfiguration>
    <ReuseAddress>true</ReuseAddress>
    <!-- suggested settings for video on demand applications -->
    <!--
    <ReceiveBufferSize>32000</ReceiveBufferSize>
    <SendBufferSize>32000</SendBufferSize>
    -->

    <!-- suggest settings for low latency chat and video recording applications -->
    <ReceiveBufferSize>16000</ReceiveBufferSize>
    <SendBufferSize>16000</SendBufferSize>

    <KeepAlive>false</KeepAlive>
    <!-- <TrafficClass>0</TrafficClass> -->
    <!-- <OobInline>false</OobInline> -->
    <!-- <SoLingerTime>-1</SoLingerTime> -->
    <!-- <TcpNoDelay>false</TcpNoDelay> -->
    <AcceptorBackLog>100</AcceptorBackLog>
    </SocketConfiguration>
    <HTTPStreamerAdapterIDs>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamerAdapterIDs>
    <HTTPProviders>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPCrossdomain</BaseClass>
    <RequestFilters>*crossdomain.xml</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPClientAccessPolicy</BaseClass>
    <RequestFilters>*clientaccesspolicy.xml</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass>
    <RequestFilters>*</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    </HTTPProviders>
    </HostPort>

    <!-- 443 with SSL -->
    <!--
    <HostPort>
    <ProcessorCount>4</ProcessorCount>
    <IpAddress>*</IpAddress>
    <Port>443</Port>
    <SSLConfig>
    <KeyStorePath>${com.wowza.wms.context.VHostConfigHome}/conf/keystore.cert</KeyStorePath>
    <KeyStorePassword>[password]</KeyStorePassword>
    <KeyStoreType>JKS</KeyStoreType>
    <SSLProtocol>TLS</SSLProtocol>
    <Algorithm>SunX509</Algorithm>
    </SSLConfig>
    <SocketConfiguration>
    <ReuseAddress>true</ReuseAddress>
    <ReceiveBufferSize>24000</ReceiveBufferSize>
    <SendBufferSize>65000</SendBufferSize>
    <KeepAlive>true</KeepAlive>
    <AcceptorBackLog>100</AcceptorBackLog>
    </SocketConfiguration>
    <HTTPStreamerAdapterIDs>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamerAdapterIDs>
    <HTTPProviders>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPClientAccessPolicy</BaseClass>
    <RequestFilters>*clientaccesspolicy.xml</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPCrossdomain</BaseClass>
    <RequestFilters>*crossdomain.xml</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass>
    <RequestFilters>*</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    </HTTPProviders>
    </HostPort>
    -->

    <!-- Admin HostPort -->
    <HostPort>
    <ProcessorCount>1</ProcessorCount>
    <IpAddress>*</IpAddress>
    <Port>8086</Port>
    <SocketConfiguration>
    <ReuseAddress>true</ReuseAddress>
    <ReceiveBufferSize>16000</ReceiveBufferSize>
    <SendBufferSize>16000</SendBufferSize>
    <KeepAlive>true</KeepAlive>
    <AcceptorBackLog>100</AcceptorBackLog>
    </SocketConfiguration>
    <HTTPStreamerAdapterIDs></HTTPStreamerAdapterIDs>
    <HTTPProviders>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.streammanager.HTTPStreamManager</BaseClass>
    <RequestFilters>streammanager*</RequestFilters>
    <AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPServerInfoXML</BaseClass>
    <RequestFilters>serverinfo*</RequestFilters>
    <AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPConnectionInfo</BaseClass>
    <RequestFilters>connectioninfo*</RequestFilters>
    <AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPConnectionCountsXML</BaseClass>
    <RequestFilters>connectioncounts*</RequestFilters>
    <AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    <HTTPProvider>
    <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass>
    <RequestFilters>*</RequestFilters>
    <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    </HTTPProviders>
    </HostPort>

    </HostPortList>

    <HTTPStreamerAdapters>
    <HTTPStreamerAdapter>
    <ID>smoothstreaming</ID>
    <Name>smoothstreaming</Name>
    <Properties>
    </Properties>
    </HTTPStreamerAdapter>
    <HTTPStreamerAdapter>
    <ID>cupertinostreaming</ID>
    <Name>cupertinostreaming</Name>
    <Properties>
    </Properties>
    </HTTPStreamerAdapter>
    <HTTPStreamerAdapter>
    <ID>sanjosestreaming</ID>
    <Name>sanjosestreaming</Name>
    <Properties>
    </Properties>
    </HTTPStreamerAdapter>
    </HTTPStreamerAdapters>

    <HandlerThreadPool>
    <PoolSize>240</PoolSize>
    </HandlerThreadPool>
    <TransportThreadPool>
    <PoolSize>160</PoolSize>
    </TransportThreadPool>
    <IdleWorkers>
    <WorkerCount>8</WorkerCount>
    <CheckFrequency>100</CheckFrequency>
    <MinimumWaitTime>5</MinimumWaitTime>
    </IdleWorkers>
    <NetConnections>
    <ProcessorCount>8</ProcessorCount>
    <IdleFrequency>250</IdleFrequency>
    <SocketConfiguration>
    <ReuseAddress>true</ReuseAddress>
    <ReceiveBufferSize>65000</ReceiveBufferSize>
    <SendBufferSize>24000</SendBufferSize>
    <KeepAlive>true</KeepAlive>
    <!-- <TrafficClass>0</TrafficClass> -->
    <!-- <OobInline>false</OobInline> -->
    <!-- <SoLingerTime>-1</SoLingerTime> -->
    <!-- <TcpNoDelay>false</TcpNoDelay> -->
    <AcceptorBackLog>100</AcceptorBackLog>
    </SocketConfiguration>
    </NetConnections>
    <HTTPTunnel>
    <KeepAliveTimeout>2000</KeepAliveTimeout>
    </HTTPTunnel>
    <Client>
    <ClientTimeout>90000</ClientTimeout>
    <IdleFrequency>500</IdleFrequency>
    </Client>
    <!-- RTP/Authentication/Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
    <RTP>
    <IdleFrequency>75</IdleFrequency>
    <DatagramConfiguration>
    <Incoming>
    <ReuseAddress>true</ReuseAddress>
    <ReceiveBufferSize>256000</ReceiveBufferSize>
    <SendBufferSize>65000</SendBufferSize>
    <!-- <MulticastBindToAddress>true</MulticastBindToAddress> -->
    <!-- <MulticastInterfaceAddress>192.168.1.22</MulticastInterfaceAddress> -->
    <!-- <TrafficClass>0</TrafficClass> -->
    <MulticastTimeout>50</MulticastTimeout>
    <DatagramMaximumPacketSize>4096</DatagramMaximumPacketSize>
    </Incoming>
    <Outgoing>
    <ReuseAddress>true</ReuseAddress>
    <ReceiveBufferSize>65000</ReceiveBufferSize>
    <SendBufferSize>65000</SendBufferSize>
    <!-- <MulticastBindToAddress>true</MulticastBindToAddress> -->
    <!-- <MulticastInterfaceAddress>192.168.1.22</MulticastInterfaceAddress> -->
    <!-- <TrafficClass>0</TrafficClass> -->
    <MulticastTimeout>50</MulticastTimeout>
    <DatagramMaximumPacketSize>4096</DatagramMaximumPacketSize>
    </Outgoing>
    </DatagramConfiguration>
    <UnicastIncoming>
    <ProcessorCount>4</ProcessorCount>
    </UnicastIncoming>
    <UnicastOutgoing>
    <ProcessorCount>8</ProcessorCount>
    </UnicastOutgoing>
    <MulticastIncoming>
    <ProcessorCount>4</ProcessorCount>
    </MulticastIncoming>
    <MulticastOutgoing>
    <ProcessorCount>4</ProcessorCount>
    </MulticastOutgoing>
    </RTP>
    <Application>
    <ApplicationTimeout>60000</ApplicationTimeout>
    <PingTimeout>12000</PingTimeout>
    <ValidationFrequency>20000</ValidationFrequency>
    <MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
    <MaximumSetBufferTime>60000</MaximumSetBufferTime>
    </Application>
    <StartStartupStreams>true</StartStartupStreams>
    <!-- Properties defined here will be added to the IVHost.getProperties() collection -->
    <Properties>
    </Properties>
    </VHost>
    </Root>
    setenv.sh
    #!/bin/sh

    _EXECJAVA=java
    JAVA_OPTS="-Xmx5000M"

    # Uncomment to run server environment (faster), Note: will only work if server VM install, comes with JDL
    JAVA_OPTS="$JAVA_OPTS -server"

    # Can be a better GC setting to avoid long pauses
    #JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC"
    JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=512m"

    # Uncomment to fix multicast crosstalk problem when streams share multicast port
    JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"

    WMSAPP_HOME=/usr/local/WowzaMediaServer
    WMSCONFIG_HOME=/usr/local/WowzaMediaServer
    WMSCONFIG_URL=

    export WMSAPP_HOME WMSCONFIG_HOME JAVA_OPTS _EXECJAVA
    Last edited by Sickiiz; 09-22-2014 at 05:51 AM.

  2. #2

    Default

    Hi,

    It is impossible from the information provide to determine why the CPU usage is high, ie. the server could just be busy.

    I would double check your configuration, so tuning, based on information found here

    http://www.wowza.com/forums/content.php?46#tune_xml

    Quickly looking over the VHost you have posted the pool sizes are not correct for 8 cores.

    Andrew.

  3. #3
    Join Date
    Sep 2014
    Posts
    2

    Default

    [total-core-count] = 1 (processor) x 4 (cores) = 4

    HandlerThreadPool/PoolSize: (60x[total-core-count]) = 60x4 =240
    TransportThreadPool/PoolSize: (40x[total-core-count]) = 40x4 =160

    Why pool sizes are not correct?

Similar Threads

  1. Java with 100% CPU
    By kalilcosta in forum Live Streaming and Encoder Discussion
    Replies: 6
    Last Post: 08-16-2013, 09:17 AM
  2. why cpu goes 100% with 400 users?
    By dirtystar in forum General Forum
    Replies: 6
    Last Post: 05-30-2012, 07:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •