CPU Usage
  • Hi,

    i just installed airtime 1.8.1 on my debian squeeze 64bits dedicated server (deb from your repository).

    I configured it to be used with icecast2, with both mp3 and vorbis stream.

    I got an average 20% CPU usage for PYPO, even when Airtime doesn't play and with icecast2 stopped.

    Here's a piece of my ps -faux return :

    USER       PID %CPU %MEM    VSZ   RSS STAT START   TIME COMMAND
    root      1716  0.0  0.1   3944   440 S    10:55   0:00  \_ svscan /etc/service
    root      1718  0.0  0.1   3772   384 S    10:55   0:02  |   \_ supervise pypo
    pypo     28809 19.0  0.0      0     0 Z    12:02   0:00  |   |   \_ [python] <defunct>
    


    It seems a bit cpu expensive !

    Is it normal ? The Zombie status on pypo is normal too ?
    What can i do to reduce this ?

    I installed everything between yesterday and today (18 mars 2011)
    so i guess i have everything up to date..

    Thanks !

    Best Regards,

    Thomas
  • 10 Comments sorted by
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hi Thomas,

    first of all try to reboot the server.
    [python] <defunct> could be possible in case new installation or re-installation pypo services.
  • hi Andrey,

    i already tried this, but no changes...
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hmm, I have several installed airtime instances on ubuntu 10.10 64-bit w/o any issue
    Please, look at /var/log/airtime/pypo/current log for any errors
  • ok here is the deal :

    on every restart, Pypo failed on retrieving AirTime version number
    @400000004dd3daa6328fbbb4 *** Daemontools: starting daemon
    @400000004dd3daa7013bcdb4 ###########################################
    @400000004dd3daa7013cdf24 #             *** pypo  ***               #
    @400000004dd3daa7013d7b64 #   Liquidsoap Scheduled Playout System   #
    @400000004dd3daa7013e0fd4 ###########################################
    @400000004dd3daa70143d84c 2011-05-18 14:41:33,021 DEBUG - [cue_file.py : __init__() : line 20] - init
    @400000004dd3daa70147240c 2011-05-18 14:41:33,021 DEBUG - [api_client.py : __get_airtime_version() : line 121] - Trying to contact http://localhost:80/api/vers$
    @400000004dd3daa70179673c 2011-05-18 14:41:33,024 DEBUG - [api_client.py : __get_airtime_version() : line 127] - Data: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML$
    @400000004dd3daa701796f0c <html><head>
    @400000004dd3daa7017972f4 <title>404 Not Found</title>
    @400000004dd3daa7017976dc </head><body>
    @400000004dd3daa701797ac4 <h1>Not Found</h1>
    @400000004dd3daa701797eac <p>The requested URL /api/version/api_key/O3A7WLTBL8EH1KRM5Q2V was not found on this server.</p>
    @400000004dd3daa701798294 <hr>
    @400000004dd3daa70179867c <address>Apache/2.2.16 (Debian) Server at localhost Port 80</address>
    @400000004dd3daa70179ad8c </body></html>
    @400000004dd3daa70179b174
    @400000004dd3daa7017d188c 2011-05-18 14:41:33,024 ERROR - [api_client.py : __get_airtime_version() : line 155] - Unable to detect Airtime Version - tuple index$
    @400000004dd3daa7017f2bcc Unable to get Airtime version number.
    


    if i well analyse the error, it seems that he try to contact http://localhost:80/api/version/api_key/%%api_key%%

    but for sure there will be no answer at this adress as i configured a virtual host for Airtime !
    (my server is also a http webserver hosting different domains an applications)

    By digging a bit i founded /etc/airtime/pypo.cfg and i changed the base_url with the good one for me : 'radio.airlab.fr'

    -> did i miss something so that happened ? or is it just a forgot in your documentation ?


    I have reboot the server,
    now pypo found Airtime version (1.8.1) and is happy as he is compatible with this version.

    BUT, i have now a new error in the pypo log, that i can not understand Very Happy

    @400000004dd3dd30194450ac *** Daemontools: starting daemon
    @400000004dd3dd302372fd44 ###########################################
    @400000004dd3dd302373eb8c #             *** pypo  ***               #
    @400000004dd3dd30237487cc #   Liquidsoap Scheduled Playout System   #
    @400000004dd3dd3023751c3c ###########################################
    @400000004dd3dd30237ad514 2011-05-18 14:52:22,595 DEBUG - [cue_file.py : __init__() : line 20] - init
    @400000004dd3dd30237e1904 2011-05-18 14:52:22,595 DEBUG - [api_client.py : __get_airtime_version() : line 121] - Trying to contact http://radio.airlab.fr:80/a$
    @400000004dd3dd302b94ce94 2011-05-18 14:52:22,730 DEBUG - [api_client.py : __get_airtime_version() : line 127] - Data: {"version":"1.8.1"}
    @400000004dd3dd302b94da4c 2011-05-18 14:52:22,730 DEBUG - [api_client.py : __get_airtime_version() : line 130] - Airtime Version 1.8.1 detected
    @400000004dd3dd302b94de34 Airtime version: 1.8.1
    @400000004dd3dd302b94e21c pypo is compatible with this version of Airtime.
    @400000004dd3dd302b94e604
    @400000004dd3dd302b94e9ec 2011-05-18 14:52:22,730 DEBUG - [cue_file.py : __init__() : line 20] - init
    @400000004dd3dd302bd9558c 2011-05-18 14:52:22,731 DEBUG - [cue_file.py : __init__() : line 20] - init
    @400000004dd3dd302bd95974 2011-05-18 14:52:22,731 INFO - [pypofetch.py : __init__() : line 64] - Initializing RabbitMQ stuff
    @400000004dd3dd302c40cdd4 Traceback (most recent call last):
    @400000004dd3dd302c43890c 2011-05-18 14:52:22,742 INFO - [pypopush.py : run() : line 231] - heartbeat
    @400000004dd3dd302c45bb8c 2011-05-18 14:52:22,742 DEBUG - [pypopush.py : push() : line 135] - Notifying Liquidsoap to stop playback.
    @400000004dd3dd302c4a8234 2011-05-18 14:52:22,742 ERROR - [pypopush.py : run() : line 235] - Pypo Push Error, exiting: [Errno 111] Connection refused
    @400000004dd3dd302c4c530c   File "/usr/lib/airtime/pypo/bin/pypo-cli.py", line 147, in <module>
    @400000004dd3dd302c4d6094     pf = PypoFetch(q)
    @400000004dd3dd302c4e3b54   File "/usr/lib/airtime/pypo/bin/pypofetch.py", line 68, in __init__
    @400000004dd3dd302c4efea4     channel = self.connection.channel()
    @400000004dd3dd302c4fcdac   File "/usr/local/lib/python2.6/dist-packages/kombu/connection.py", line 123, in channel
    @400000004dd3dd302c50b03c     chan = self.transport.create_channel(self.connection)
    @400000004dd3dd302c517f44   File "/usr/local/lib/python2.6/dist-packages/kombu/connection.py", line 438, in connection
    @400000004dd3dd302c53407c     self._connection = self._establish_connection()
    @400000004dd3dd302c54230c   File "/usr/local/lib/python2.6/dist-packages/kombu/connection.py", line 404, in _establish_connection
    @400000004dd3dd302c55c504     conn = self.transport.establish_connection()
    @400000004dd3dd302c5697f4   File "/usr/local/lib/python2.6/dist-packages/kombu/transport/pyamqplib.py", line 242, in establish_connection
    @400000004dd3dd302c57c0d4     connect_timeout=conninfo.connect_timeout)
    @400000004dd3dd302c588bf4   File "/usr/local/lib/python2.6/dist-packages/kombu/transport/pyamqplib.py", line 51, in __init__
    @400000004dd3dd302c59438c     super(Connection, self).__init__(*args, **kwargs)
    @400000004dd3dd302c5a0eac   File "/usr/local/lib/python2.6/dist-packages/amqplib/client_0_8/connection.py", line 125, in __init__
    @400000004dd3dd302c5af13c     self.transport = create_transport(host, connect_timeout, ssl)
    @400000004dd3dd302c5bc42c   File "/usr/local/lib/python2.6/dist-packages/amqplib/client_0_8/transport.py", line 220, in create_transport
    @400000004dd3dd302c5cc214     return TCPTransport(host, connect_timeout)
    @400000004dd3dd302c5d8d34   File "/usr/local/lib/python2.6/dist-packages/amqplib/client_0_8/transport.py", line 58, in __init__
    @400000004dd3dd302c5e48b4     self.sock.connect((host, port))
    @400000004dd3dd302c5f13d4   File "<string>", line 1, in connect
    @400000004dd3dd302c6067ac socket.error: [Errno 111] Connection refused
    


    Any idea ?

    Thank you very much for your time,

    Best regards,

    Thomas









  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    ok, seems the apache server conf is fixed.
    The error "socket.error: [Errno 111] Connection refused" says that RabbitMQ is not accessible. Check it.
  • How do i now if rabbitMQ is running ?

    i got this in my pypo.cfg conserning rabbitMQ

    rabbitmq_host = 'localhost'
    rabbitmq_user = 'guest'
    rabbitmq_password = 'guest'

    do i have to fix the host the same way i did for pypo (by replacing localhost with radio.airlab.fr ?)
    or localhost is ok for this app ?

    i don't know what i have to look for, actually i don't even know what rabbitMQ is Smile

    Thanks !
  • i also just tried to update my station info in Airtime,

    and a little error just appeard on top (after a long lag) :

    Warning: fsockopen(): unable to connect to 127.0.0.1:5672 (Connection refused) in /var/lib/airtime/library/php-amqplib/amqp.inc on line 376

    guess 5672 is the rabbitmq port !

    i'll try to open it in my iptables...
  • nothing changed..

    the same connection error,

    i got this in my ps -faux :

    root      2008  0.0  0.0   4000    92 Ss   15:33   0:00 /bin/sh /usr/bin/svscanboot
    root      2010  0.0  0.0   3944   124 S    15:33   0:00  \_ svscan /etc/service
    root      2012  0.0  0.0   3772    72 S    15:33   0:00  |   \_ supervise pypo
    pypo      3072  0.0  0.2  12312   696 D    15:37   0:00  |   |   \_ setuidgid pypo python -u /usr/lib/airtime/pypo/bin/pypo-cli.py
    root      2013  0.0  0.0   3772    64 S    15:33   0:00  |   \_ supervise log
    pypo      2021  0.0  0.0   3916    88 S    15:33   0:00  |   |   \_ multilog t /var/log/airtime/pypo/main
    root      2014  0.0  0.0   3772   112 S    15:33   0:00  |   \_ supervise pypo-liquidsoap
    root      3073  0.0  0.0      0     0 Z    15:37   0:00  |   |   \_ [run] <defunct>
    root      2015  0.0  0.0   3772    64 S    15:33   0:00  |   \_ supervise log
    pypo      2019  0.0  0.0   3784    80 S    15:33   0:00  |   |   \_ multilog t /var/log/airtime/pypo-liquidsoap/main
    root      2016  0.0  0.0   3772   120 S    15:33   0:00  |   \_ supervise recorder
    root      3069  0.0  0.0      0     0 Z    15:37   0:00  |   |   \_ [run] <defunct>
    root      2017  0.0  0.0   3772    68 S    15:33   0:00  |   \_ supervise log
    pypo      2023  0.0  0.0   3784   108 S    15:33   0:00  |       \_ multilog t /var/log/airtime/show-recorder/main
    root      2011  0.0  0.0   3760    64 S    15:33   0:00  \_ readproctitle service errors: ................
    


    -> there is 2 Zombies : [run] for pypo-liquidsoap et [run] for recorder

    and i still have the message
    Warning: fsockopen(): unable to connect to 127.0.0.1:5672 (Connection refused) in /var/lib/airtime/library/php-amqplib/amqp.inc on line 376
    in Airtime interface

    any clue ?

    thanks
  • ok i'll start a new topic about RabbitMQ disfunction

    (how do i close this one ?)

    Thanks !
  • try:
    service rabbitmq-server start
    

    then post your logs Wink