Hi, Cassiano,

Every AJAX request coming from a single browser page will use the same PHP session. This session (really a temp file) is locked during the PHP request to ensure that the session is updated by one request at a time. This locking is the most likely cause of your problem. To resolve the issue, use session_write_close() after updating $_SESSION in your scripts.

Alan
--
Alan Seiden Consulting LLC

Project leader, Zend PHP Toolkit for IBM i
Zend Framework certified contributor

Office: 201-447-2437 Cell: 201-248-4704
http://www.alanseiden.com | alan@xxxxxxxxxxxxxx
http://twitter.com/alanseiden

On Jan 27, 2016, at 12:57 PM, c.vailati@xxxxxxxxxxxxxxx wrote:

Hello to everyone,
I’m experimenting some performance issues on an IBMi machine running PHP and I would like to ask if someone have some hints.

Some premises about the environment:
IBMi Power 8 with OS400 V7R2 on a IASP storage
Zend Server 8.5.1 with Z-Ray and many other services disabled, at the moment we just use the HTTP Apache service and the XMLTOOLKIT service.

We are running a PHP application which receives many concurrent ajax (asynchronous request) per user from the browser.
At this point we would expect that all the requests are handled in parallel processes.
But running the WRKACTJOB on the server produces just a few (one or sometimes two) actual working jobs as follows:

Subsystem User Type CPU Status
QSQSRVR ESCPHP PJ 2,1 RUN

We understood that the QSQSRVR Pre-start Job is the connection to the database and our application is structured to open one single new, non persistent, connection for each request.
It seems that our requests at this point are not handled concurrently, but re-using the same Pre-start Job even for different requests.
So the first Ajax requests give a fast and correct answer to the browser, but the last ones end up in a Timeout Request.

We already tried to do some tuning on the fastcgi.conf:
StartProcesses="1" => StartProcesses="2"
SetEnv="PHP_FCGI_CHILDREN=10" => SetEnv="PHP_FCGI_CHILDREN=40"

This operation opened more Apache/Zend Server sockets, but did not change the behavior of QSQSRVR
Subsystem User Type CPU Status
ZENDSVR6 QTMHHTTP BCI 0,0 PGM-php-cgi.bi TIMW

On a different server (a testing environment) we tried to enhance the number of Pre-start Job available for QSQSRVR using the following command and restarting the system, but we experienced the same issue:
ADDPJE SBSD(QSYSWRK/QSQSRVR) PGM(QSYS/QSQSRVR) STRJOBS(*YES) INLJOBS(50) THRESHOLD(40) ADLJOBS(20) MAXUSE(*NOMAX)

Is there some info that I’m missing or some other configuration that I could try?
Thank you in advance for your help
Have a nice evening

Cassiano Vailati - ESC
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.