From YiPs Wiki (i powered)

XMLSERVICE: XMLSERVICE Config

(click to open)

Quick Page Table of Contents

Scanning…

XMLSERVICE Performance

Goto Main Page
Goto Documents

You may want to refer to the DB2 connection link before reading this page PHP DB2 Connection topics.

You may also want to refer to general “run slow” link before reading this page running slow?

Performance at a glance

The following tests are full browser simulations (Apache ab tool), not PHP loop tests

Connection Sample (ab tool)
Apache <H1>Hello world</H1> ...................................... Requests per second: 767.87 [#/sec] (mean)
PHP <?php echo "Hello world"; ?> .............................. Requests per second: 560.05 [#/sec] (mean)
(1) ibm_db2

$conn = db2_connect($database,$user,$password); ........... Requests per second: 64.54 [#/sec] (mean) $conn = db2_pconnect($database,$user,$password);........... Requests per second: 504.04 [#/sec] (mean)

$ipc     = "";
$ctl     = "*justproc";          // *justproc (no progam call)
$clobIn  = "<?xml version='1.0'?>";
$clobOut = "";
$stmt = db2_prepare($conn, "call XMLSERVICE.iPLUG4K(?,?,?,?)");
$ret  = db2_bind_param($stmt, 1, "ipc", DB2_PARAM_IN);
$ret  = db2_bind_param($stmt, 2, "ctl", DB2_PARAM_IN);
$ret  = db2_bind_param($stmt, 3, "clobIn", DB2_PARAM_IN);
$ret  = db2_bind_param($stmt, 4, "clobOut", DB2_PARAM_OUT);
$ret  = db2_execute($stmt);
echo "success";
(2) XMLSERVICE

$ipc = ''; $ctl = '*here'; ................................ Requests per second: 69.58 [#/sec] (mean) $ipc = '/tmp/packers'; $ctl = '*sbmjob'; .................. Requests per second: 320.72 [#/sec] (mean)

<?php
require_once('connection2.inc');
if ($i5persistentconnect) $conn = db2_pconnect($database,$user,$password);
else $conn = db2_connect($database,$user,$password);
if (!$conn) echo "Bad connect: $conn,$database,$user,perm=$i5persistentconnect";
$ipc  = '/tmp/packers';    // *here no need ipc
$ctl  = "*sbmjob";         // *here for no additional private job 
// $ipc  = '';
// $ctl  = '*here';
$clobIn = "<?xml version='1.0'?>
<pgm name='ZZCALL' lib='$libxmlservice'>
 <parm  io='both'>
   <data type='1A'>a</data>
 </parm>
 <parm  io='both'>
   <data type='1A'>b</data>
 </parm>
 <parm  io='both'>
   <data type='7p4'>11.1111</data>
 </parm>
 <parm  io='both'>
   <data type='12p2'>222.22</data>
 </parm>
 <parm  io='both'>
  <ds>
   <data type='1A'>x</data>
   <data type='1A'>y</data>
   <data type='7p4'>66.6666</data>
   <data type='12p2'>77777.77</data>
  </ds>
 </parm>
 <return>
  <data type='10i0'>0</data>
 </return>
</pgm>";
$clobOut = "";
$stmt = db2_prepare($conn, "call XMLSERVICE.iPLUG4K(?,?,?,?)");
$ret=db2_bind_param($stmt, 1, "ipc", DB2_PARAM_IN);
$ret=db2_bind_param($stmt, 2, "ctl", DB2_PARAM_IN);
$ret=db2_bind_param($stmt, 3, "clobIn", DB2_PARAM_IN);
$ret=db2_bind_param($stmt, 4, "clobOut", DB2_PARAM_OUT);
$ret=db2_execute($stmt);
// var_dump($clobOut);
if (strpos($clobOut,"4444444444.44")>0) echo "success";
else echo "fail";
?>
(3) Toolkit

setToolkitServiceParams(array('stateless'=>true)); ................. Requests per second: 62.97 [#/sec] (mean) setToolkitServiceParams(array('InternalKey'=>'/tmp/packers')); ..... Requests per second: 162.75 [#/sec] (mean)

<?php
require_once('connection2.inc');
require_once("ToolkitService.php");
if ($i5persistentconnect) $conn = db2_pconnect($database,$user,$password);
else $conn = db2_connect($database,$user,$password);
if (!$conn) echo "Bad connect: $conn,$database,$user,perm=$i5persistentconnect";
try { $ToolkitServiceObj = ToolkitService::getInstance($conn); }
catch (Exception $e) { die($e->getMessage()); }
// $ToolkitServiceObj->setToolkitServiceParams(array('stateless'=>true,'plug'=>'iPLUG32K'));
$ToolkitServiceObj->setToolkitServiceParams(array('InternalKey'=>'/tmp/packers','plug'=>'iPLUG32K'));
$param[] = $ToolkitServiceObj->AddParameterChar   ('both',  1,  'INCHARA', 'var1', 'Y');
$param[] = $ToolkitServiceObj->AddParameterChar   ('both',  1,  'INCHARB', 'var2', 'Z');
$param[] = $ToolkitServiceObj->AddParameterPackDec('both',  7,4,'INDEC1',  'var3', '001.0001');
$param[] = $ToolkitServiceObj->AddParameterPackDec('both', 12,2,'INDEC2',  'var4', '0000000003.04');
   $ds[] = $ToolkitServiceObj->AddParameterChar   ('both',  1,  'DSCHARA', 'ds1',  'A');
   $ds[] = $ToolkitServiceObj->AddParameterChar   ('both',  1,  'DSCHARB', 'ds2',  'B');
   $ds[] = $ToolkitServiceObj->AddParameterPackDec('both',  7,4,'DSDEC1',  'ds3',  '005.0007');
   $ds[] = $ToolkitServiceObj->AddParameterPackDec('both', 12,2,'DSDEC1',  'ds4',  '0000000006.08');
$param[] = $ToolkitServiceObj->AddDataStruct($ds);
$clobOut  = $ToolkitServiceObj->PgmCall('ZZCALL', $libxmlservice, $param, null, null);
// var_dump($clobOut);
$value = "what is ...".$clobOut["io_param"]["ds4"];
if (strpos($value,"4444444444.44")>-1) echo "success";
else echo "fail";
?>

How many users?

Apache ab tool is designed to “exercise” CPU/Apache engine as fast as possible, therefore ‘ab tool’ requests/second multiply by a factor of 5–10x to estimate ‘user capacity’ assuming humans actually read/scan each browser page (~ 5–10 seconds per page). So, on this machine using just ibm_db2 without toolkit, the following is about as fast as any given connection can run using only ONE job.

Drive the CPU to 100% capacity, then estimate actual users supported to drive the same CPU 100%.
>> ab -t 15 -c 15 http://lp0264d/ibm_db2_fetch.php?pool
       483 requests/second..............483 users/second (varies widely per application base line)
    28,980 requests/minute..............600 users/minute (relatively constant user capacity ibm_db2 scripts persistent connections)
 1,738,800 requests/hour.............36,000 users/hour   (relatively constant user capacity ibm_db2 scripts persistent connections)
41,731,200 requests/day (24 hours)..864,000 users/day    (relatively constant user capacity ibm_db2 scripts persistent connections)

Things to consider:

If you want to run Apache ab tool on PASE (IBM i) …

  • ab — Apache ab tool from old Zend Core (simulate browsers)

XMLSERVICE still evolving

Toolkit/XMLSERVICE performance will evolve over time, we understand performance is important and we intend push data through faster (perhaps much faster).


Author(s)

Tony “Ranger” Cairns - IBM i PHP / PASE

Retrieved from http://youngiprofessionals.com/wiki/index.php/XMLSERVICE/XMLSERVICEConfig
Page last modified on October 21, 2013, at 03:50 PM EST