PHP Application Hangs

PHP Application Hangs

Postby richardwebster on Wed Jun 20, 2012 2:47 pm

Hi, I hope someone can help please.

We have written a web application in PHP using Zend installed on an IBM i server. SQL connections to the server are done using the db2 utilities (db2_pconnect, db2_prepare, db2_bind_param and db2_execute functions). It also makes calls to RPG procedures using the new XTOOLKIT toolkit.

At the start of last week we went live with a pilot client. Users have reported that every now and then (maybe 3 or 4 times a day) the application hangs and grinds to a halt. Ending and restarting the Zend server resolves it until the next time but I need to find the cause to stop it happening in the first place.

The only relevant message I can see in the Zend server log is:
Code: Select all
PHP Warning:  db2_prepare() [<a href='function.db2-prepare'>function.db2-prepare</a>]: Statement Prepare Failed in xxxxxxxxxx on line 96

(where ‘xxxxxxxxxx on line 96’ is where my PHP calls db2-prepare). But I think this is symptom rather than a cause.

Looking elsewhere, in the QTMHHTTP/ZENDSVR jobs I see an occurrence of message:
Code: Select all
Connection to relational database XXXXXXXXXX does not exist.
[SQL0843, where XXXXXXXXXX is our IBM i name]
and several occurrences of message:
Code: Select all
Error occurred in SQL Call Level Interface
[SQ99999, with error code 10 – ‘Function sequence error’]

The measures we have taken so far are:
1. Following the advice at http://www-304.ibm.com/support/docview.wss?uid=swg21476411 since we noticed that lots of the QSQSRVR jobs (where I believe the SQL statement run) seemed to be stuck at status JOBLOG PENDING. We wondered if Zend was trying to reuse some of these dying jobs.
2. Increasing time-out values in php.ini (max_execution_time), httpd.conf and fastcgi.conf, in case response time-outs are causing a connection to be lost.
3. Performance improvements to our application, for the same reason.
Since then the application generally seems to be running faster, and we no longer get the JOBLOG PENDING jobs, and but we still get the hanging.

We are using PHP version 5.3.8-ZS5.5.0, Zend Framework (CE) version 1.11.10, and version V5R4M0 of the IBM i O/S.

Any assistance or pointers would be gratefully received. We are quite new to PHP and Zend so may have overlooked something obvious.
richardwebster
 
Posts: 5
Joined: Tue May 01, 2012 4:35 pm

Re: PHP Application Hangs

Postby erich_hieden on Thu Jun 21, 2012 12:08 pm

Hello Richard

First of all welcome to the world of PHP on IBM i! And thank you for putting all that information in the opening post.

What I saw and what might be (bust isn't necessarily) a problem: V5R4. I know that every requirement list you find, says V5R4 is OK, but you might be missing some PTFs. IMO it's best to use at least V6R1, there's no major difference to V7R1 in this case.

I had a similar problem with the old easycom toolkit which ceased to work until restarted. The problem was always a program error which forced the job into MSGW state. From then on this user couldn't use his connection anymore.

My advice would be to look for a job in MSGW state and get i5/OS up to V6R1.

Best
erich_hieden
 
Posts: 349
Joined: Tue Jul 07, 2009 9:01 am

Re: PHP Application Hangs

Postby richardwebster on Fri Aug 03, 2012 2:52 pm

Hi Erich.

Thanks for your reply.

Just to let you know the problem seems to be fixed now.

We tried several things but the one that seems to have sorted it was upgrading the XML toolkit to the (then) latest version from the http://www.youngiprofessionals.com/wiki/XMLSERVICE site.

- We upgraded the XML Service (RPG) to 1.6.11 (from 1.6.7).
- We upgraded the PHP Client to 1.2.6 (from 1.2.5).

That was two weeks ago and we've had no crashes since, as opposed to several crashes most days before we upgraded :)
richardwebster
 
Posts: 5
Joined: Tue May 01, 2012 4:35 pm


Return to Zend Server for IBM i

Who is online

Users browsing this forum: amcusack and 1 guest

cron