The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Excessive processes running under user mysite

Discussion in 'General Discussion' started by ashishpatel1992, Jan 8, 2014.

  1. ashishpatel1992

    Joined:
    Jan 8, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I am getting Excessive processes running under user test message a lot:-
    Code:
    User:testuser  PID:10553 PPID:8579 Run Time:29(secs) Memory:139704(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/testuser/public_html/listeners.php
    User:testuser PID:10564 PPID:3100 Run Time:29(secs) Memory:139704(kb) exe:/usr/bin/php cmd:/usr/bin/php /home/testuser/public_html/listeners.php
    
    The code inside listeners.php is:-
    PHP:
    <?php
    //-----------------------------------------------------------------------------------------------------------------
    // Icecast2/Shoutcast Station Status 2.0  Php Module  - Dards, WhooshStream.com
    // Description: this module use to grab the icecast server status and generate an xml data for AAC+ Flash player
    // Note: the fsockopen php function must be enabled on your server for this script to work
    //-----------------------------------------------------------------------------------------------------------------



    $host         =    "192.168.1.2";         // ip or url of shoutcast server
    $port         =    "8014";                  // port of shoutcast server 
    $servertype    =    "shoutcast";            // shoutcast / icecast



    // no do not edit the code below----------------------------------------------------------------------------------- 
    $fp = @fsockopen($host$port$errno$errstr30);
    if(
    $fp)
    {
        
    $servertype=strtolower($servertype);
        switch(
    $servertype){
            case 
    "shoutcast":
                
    fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: GET SEVEN (Mozilla Compatible)\r\n\r\n");
            break;    
            case 
    "icecast":
            
    fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: GET SEVEN (Mozilla Compatible)\r\n\r\n");
            break;
        }
        
    $data="";
        while(!
    feof($fp))
        {
            
    $data .= fgets($fp1000);
        }
        
    fclose($fp);
        
    $data              ereg_replace(".*<body>"""$data);
        
    $data              ereg_replace("</body>.*"","$data);
        
    $data_array        explode(",",$data);
        
        
    //print_r($data_array);
     
        
    switch($servertype){
            case 
    "shoutcast":
                
    $listeners         $data_array[0];
                
    $status            $data_array[1];
                
    $peak_listeners    $data_array[2];
                
    $maximum_listeners $data_array[3];
                
    $unique_listeners  $data_array[4];
                
    $bitrate           $data_array[5];
                
    $track             $data_array[6];
            break;    
            case 
    "icecast":
                
    $bitrate           "128k";
                
    $unique_listeners  $data_array[14];
                
    $track             $data_array[16];        
            break;
        }

     
        
    $title  chop($track);
        
    $select explode(" - ",$title);
        
    $artist chop($select[0]);
        
        if(
    count($select)<2){
            
    $title  chop($select[0]);
        }else{
            
    $title  chop($select[1]);    
        }
        
        
    header ("content-type: text/xml");
        echo 
    "<?xml version=\"1.0\" standalone=\"yes\"?>\n";
        echo 
    "<status>\n";
        echo 
    "    <status>on</status>\n";
        echo 
    "    <listeners>$unique_listeners</listeners>\n";
        echo 
    "    <peaklisteners>0</peaklisteners>\n";
        echo 
    "    <bitrate>$bitrate</bitrate>\n";
        echo 
    "    <artist><![CDATA[$artist]]></artist>\n";
        echo 
    "    <title><![CDATA[$title]]></title>\n";
        echo 
    "</status>\n"
    }else{
        
    header ("content-type: text/xml");
        echo 
    "<?xml version=\"1.0\" standalone=\"yes\"?>\n";
        echo 
    "<status>\n";
        echo 
    "    <status>off</status>\n";
        echo 
    "    <listeners>0</listeners>\n";
        echo 
    "    <peaklisteners>0</peaklisteners>\n";
        echo 
    "    <bitrate>0</bitrate>\n";
        echo 
    "    <artist><![CDATA[]]></artist>\n";
        echo 
    "    <title><![CDATA[]]></title>\n";
        echo 
    "</status>\n"
    }
    ?>
    Note: I have changed the $host = "192.168.1.2"; here on forum for security reasons.
    Any one know why this small script eating all process on my server?
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm guessing the messages are from CSF/LFD? That product is designed to alert you to odd processes that are running. Each run from the above looks like it is only running for 29 seconds. If you don't want to see those alerts, you can add them to the /etc/csf/csf.pignore file.

    Looking at your script, I don't see anything strange that would be causing problems. I think it is just csf/lfd (if that's what you're running) reporting that it detected a strange program/user (testuser) and is alerting you to that fact.
     
  3. ashishpatel1992

    Joined:
    Jan 8, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Due to that process it I got this email from server:-
    Time: Wed Jan 8 12:09:03 2014 -0500
    1 Min Load Avg: 22.18
    5 Min Load Avg: 7.64
    15 Min Load Avg: 2.84
    Running/Total Processes: 35/468

    and apachestatus.html says:
    Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
    0-669 24970 0/1/408323 _ 0.00 7 30668 0.0 0.00 22929.57 55.37.166.1 mywebsite.com GET /listeners.php?r=982 HTTP/1.1


    vmstat.txt
    Output from vmstat:
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
    r b swpd free buff cache si so bi bo in cs us sy id wa st
    32 0 281140 578488 212708 642060 0 0 46 82 1 1 4 2 93 1 0
    ps.txt
    Output from ps:
    Unable to obtain process output within 15 seconds - Timed out


    I dont understand this.
    Is it normal or I must do something for it?
     
  4. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    No it is not normal. The load average alone is something to be concerned about. You should investigate this thouroughly or have your system administrator investigate this. If you don't have a sysadmin, you can find one by going here.
     
Loading...

Share This Page