CPU ZEND - release v6r1m0

Discussion in 'Zend Server & PHP' started by Francesco, Jul 7, 2017.

  1. Francesco

    Francesco New Member

    Hi,
    sorry for my bad english and thank's for your help....

    I have this configuration Apache/2.2.6 (Unix), Zend Core Version 2.6.0, PHP Version 5.2.6, Zend Engine Version 2.2.0
    I've developed a php page that seems to mess up Zend Core Server ( Partial Configuration -> Multitasking model Prefork (forked: yes, threaded: no) - Max Daemons 75 ).
    I use "i5_connect( $host,$user,$pass )" for Db Connection,
    "$results = i5_query($qry)" for store data and "while($data = i5_fetch_array($results,I5_READ_NEXT)){ " for printing the result.
    There is a meta http-equiv that refresh page on 5 seconds. Max 5 - 10 clients are connected to page simultaneous.
    I must restart apache every 8/12 hours because one or more batch PHPJOB eat CPU (?).
    I try use wrkactjob sbs(ZEND) to find a PHPJOB.
    The BATCH PHPJOB eat 25% cpu to create, in my case, a IDX-TABLENAME, is a process that begins and ends right away.
    When the ZEND System seems to mess up, i launch Zend Gui Admin and i have a http error 500 status...
    When i stop the apache service i found in the error_log
    many rows of this
    [Thu Jul 06 21:30:37 2017] [warn] child process 3488852 still did not exit, sending a SIGTERM
    [Thu Jul 06 21:30:37 2017] [warn] child process 3488853 still did not exit, sending a SIGTERM
    [Thu Jul 06 21:30:37 2017] [warn] child process 3488854 still did not exit, sending a SIGTERM
    [Thu Jul 06 21:30:37 2017] [warn] child process 3488855 still did not exit, sending a SIGTERM
    [Thu Jul 06 21:30:37 2017] [warn] child process 3488856 still did not exit, sending a SIGTERM
    ......
    ......
    ......
    I apologize for my lack of clarity but I can not understand where the anomaly is.
    If you want to ask me questions to better understand the situation I am at your disposal.
    Thank's.
     
    Last edited: Jul 7, 2017
  2. I would be very careful with the while loop. It sounds look all of the processes are in an infinite loop and that $data is always true. Once the maximum amount of processes gets used, they will stop accepting requests because they never finish their previous request. That's why restarting Apache helps, because the previous jobs are killed.
     
    Francesco likes this.
  3. Christian Dubé

    Christian Dubé New Member

    You should also look into upgrading Zend Server.. Zend Core is a very old technology. Not sure which type of hardware you run this, but I run several V5R4 on php 5.5 (Zend Server 6.3) and I've never had a problem. As Jorge points out, you're probably stuck in a infinite loop with your while statement.
     
    Francesco likes this.
  4. Francesco

    Francesco New Member

    Great ... it's possibile this case.
    I have more while ... example while ($dsetl = i5_fetch_array($rawsqlil,I5_READ_NEXT)) { ...
    exist a method for checking if loop is infinite ? or an hint for help me to understand if this condition is true ..

    Really thank's for your help.
     
  5. Francesco

    Francesco New Member

    I do not know if i can upgrade Zend server :-(
    Exist a method for checking if loop is infinite ? or an hint for help me to understand if this condition is true ..
    Really thank's for your help.
     
  6. Christian Dubé

    Christian Dubé New Member

    It's very hard to help in that condition. You are using functions (i5_fetch_array) that are not pure PHP, but from a toolkit that are not used anymore unless you pay for it (was free with ZendCode, is a paid extension since Zend Server).

    What are the conditions that prevent for you to upgrade ?

    How big is the table you are querying ? How many while loops ? are they always bound to a ie_* method? Have you tried contacting easy-com the owner of the ie_ extension ?

    If you are doing SQL and not calling programs, change those functions to pure PHP (http://php.net/manual/en/function.db2-connect.php) you will have an easier upgrade path and most likely better support from other users who uses similiar functions.
     
    Francesco likes this.
  7. Francesco

    Francesco New Member

    I can't upgrade because i'm only a developer. It's my first php program in Zend system.
    I did not contact easy-com because i may need to have a license or a contract, but i do not have this information on the system, so i just have to pull out the data.
    Anyway, i try to use a different function to retrieve data, thank's for your link.
    I Use
    $conn = new PDO('ibm:'.$host, $user, $pass);
    $results = $conn->query( $sql );
    and while($data = $results->fetch(PDO::FETCH_ASSOC)){ ... }
    So, for now, thank's guys, i try to monitor the situation.... and hope it is resolved.
    Thank's Thank's Thank's...
     
  8. Christian Dubé

    Christian Dubé New Member

    PDO is nice. You wont be able to access library list and some other functions that db2_* offers.
     
    Francesco likes this.

Share This Page