PHP PEAR::SOAP performance issue


I am running PEAR::SOAP server with Apache2.0 and PHP4.3.3. Its fully functional except its taking 10 seconds to get the response . I tried to connect to webservices (API) like google, amazon etc and having the same response time problem.

More If i try to connect to a SOAP server running in the same box it still taking the same time.

What am I missing here?

Any Ideas are greatly appreciated.


The following code is taking 10 sec to get the response.

PHP:
--------------------------------------------------------------------------------
<?

require_once 'SOAP/Client.php';

$wsdl_url =  
  'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl';
$WSDL     = new SOAP_WSDL($wsdl_url);  
$client   = $WSDL->getProxy();  

$params   = array(
    'manufacturer' => "Addison Wesley",
    'mode'         => 'books',
    'type'         => 'lite',
    'tag'          => 'Design Patterns',
    'devtag'       => ''
);

$books    = $client->ManufacturerSearchRequest($params);


ECHO "<PRE>";
PRINT_R($books);
ECHO "</PRE>";
?>
ITHCIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_GeG_Commented:
I don't think that the problem is with PEAR::SOAP. I think this is a connection issue.

Either you have a slow dns query. You can check it like this:
<?php
echo gethostbyname('soap.amazon.com');
?>
if this takes long, it is a dns problem.

Or maybe your connection is slow, try
<?php
include(''http://soap.amazon.com/schemas3/AmazonWebServices.wsdl');
?>
This only reads the soap service. If this is fast, then it is a PEAR problem.
Otherwise it's a network problem.
0
ITHCIAuthor Commented:

I tried the steps, following are the results.

Test 1: Slow DNS :

<?php
echo gethostbyname('soap.amazon.com');
?>

result:  Its displays the ip right away with no lag.

Test2: Connection Slow: (OS: Linux SuSe)

<?php
include(''http://soap.amazon.com/schemas3/AmazonWebServices.wsdl');
?>

result :  It is taking 10 sec to show the result.

Test 3: Connection Slow: (OS: windows XP)

<?php
include(''http://soap.amazon.com/schemas3/AmazonWebServices.wsdl');
?>

result :  It is fast again.

However if I use the same windows box to connect to my SOAP server running in SuSe Linux. Its again taking 10 secs.
windows and Linux boxes are on the same network.



0
_GeG_Commented:
test1 is fast on the linux box also?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

davebytesCommented:
I assume you did multiple iterations of each test, at multiple times, and they always respond the same?  I think _GeG_ might be thinking along the same lines I am, which is maybe something is off with your SuSE box -- if it has lags, and the windows box doesn't.  Especially where then connecting the windows box to your SuSE box is slow.  There's enough pieces involved (just apache2 and php alone each with all the various configurable options)...  I assume that no other network services have any problems on the linux box?  Just PHP?  Does Apache/webserving without PHP run into any slowness issues?

Otherwise, sounds like something is off in the PHP build.  Maybe try a different version, etc.?

-d
0
ITHCIAuthor Commented:

Yes _GeG_, Test1 is fast on Linux.


DaveBytes, Yes On the Linux box the PHP ver is 4.3.8 and in windows 4.3.3. Right now I am comparing all the On/Off
of both versions php_info();

0
ITHCIAuthor Commented:

The comparison goes as follows:

 Variable/option                WIN (running fast)      -         Linux (running Slow)
---------------------         ------------------------              -------------------------
1. Thread Safety                 Enable                                   Disable
2. Hostname port                hostname:0                          localhost:80
3. SSL Support                    disable                                 enable
4. mcrypt                              -                                        enable
5. PHP ver                           4.3.8                                   4.3.3

I know SSL will make the SOAP slow. But Its just enabled, i am not using https://

0
ITHCIAuthor Commented:
Finally I installed the versions apache2.0 and php4.3.3 in my windows box.

Windows : Apache/2.0.52 (Win32) PHP/4.3.3

It is behaving the same way as Linux now. Both windows and Linux are slow.
0
_GeG_Commented:
maybe it's php 4.3.3? I don't think that ssl is the problem. But I have no idea what the problem is :(
0
ITHCIAuthor Commented:
Yes! it is PHP 4.3.3. Thanks a lot for your help.

In windows When I use the

php4apache2.dll  (from windows binary PHP 4.3.3) its SLOW.
php4apache2.dll  (from windows binary PHP 4.3.4) its SLOW.
php4apache2.dll  (from windows binary PHP 4.3.5) its FAST.
php4apache2.dll  (from windows binary PHP 4.3.6) its FAST.
php4apache2.dll  (from windows binary PHP 4.3.7) its FAST.
php4apache2.dll  (from windows binary PHP 4.3.8) its FAST.



0
_GeG_Commented:
I feel that I have answered the question
[quote from me] maybe it's php 4.3.3?[/quote]
[quote from ITHCI] Yes! it is PHP 4.3.3. Thanks a lot for your help.[/quote]
0
davebytesCommented:
Split the points.  (Note my comment earlier "Otherwise, sounds like something is off in the PHP build.  Maybe try a different version, etc.?")

-d
0
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_GeG_Commented:
just for my information, what is wrong with my answer?
0
davebytesCommented:
_GeG_: are you against a point split?  If so, modulo is probably right on -- if not, then he can split the points and close the Q.  I think we both helped equally here.

-d
0
ITHCIAuthor Commented:
Hi Every one,

FYI - Both GeG and Dave helped me equally.

However I think upgrading from PHP 4.3.3 to 4.3.5 or newer is not the only solution for this issue.
Coz updating the version is not allways possible (as it may lead to some code changes).

I am sure there sould be some way to make the SOAP run fast with 4.3.3 it self.

0
_GeG_Commented:
hi
@davebytes: of course, split would be ok

@ITHCI: I wouldn't be so sure that there is another way. When an update helps solve a probem, most of the time the problem was in the prior version.
But if you feel that you want the points refunded, that is ok by me. I just asked because I was surprised by the decision of modulo

@modulo: I didn't answer davebytes' post, because for me his post was not 'conflicting' mine. For me it seems natural if one party says this is my answer, and the other says, yes I answered it too, the result would be a split. Again, if ITHCI says he/she wants the points refunded, no problem, I was just surprised by your ruling.

Have a good time
0
davebytesCommented:
ITHCI -

I'm with GeG on this one.  If a third-party library on top of PHP suddenly breaks a bottleneck issue because of an upgrade of PHP, more likely there was a particular PHP API call that wasn't working as it should.

If you want points refunded, that's fair.  But in this case, we helped you step towards one possible solution.  That isn't the only answer to the question, but it is successful, solves the issue at hand.

-d
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.