[phpxmlrpc] Long lasting calls

Gaetano Giunta giunta.gaetano at gmail.com
Tue Aug 31 22:38:16 CEST 2010

  Attila wrote:
> Hi,
> We are using the phpxmlrpc 2.2.2 package in our code.
> An issue we run into is very long lasting calls.  We have methodCalls that are expected to take anywhere between 5 - 15 minutes.
> The problem is that there is a timeout somewhere.
> In the FAQ there is a section titled:
>     How to enable long-lasting method calls
> Can you provide a quick pointer on how to prevent the library from timing out?

Not really hard - it's just that are more than one place where a timeout is imposed:
1. use the timeout parameter in the send() method call [client side]
2. set the php script timeout limit: parameter max_execution_time in in php.ini (or via an ini_set() call if you cannot alter php.ini eg. on shared hosting) 
[both client and server]
3. make sure that the webserver serving the request does not time out in itself, e.g. the TimeOut directive for Apache might have an impact

For debugging purposes:
1. use debug level 3 on the phpxmlrpc client
2. use a network sniffer such as Wireshark


ps: for such long-lasting methods, it might be better off to split processing in multiple xmlrpc calls:
one that starts processing, gets back a token
then a loop that every X seconds asks with the given token if results are ready
server-side, the ignore_user_abort() php function could be used to make sure processing of the first call continues after sending the token response to the client

> Thank you,
> -A
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20100831/a8ad47d6/attachment.htm 

More information about the phpxmlrpc mailing list