Discussion:
[phpxmlrpc] Long lasting calls
Attila
2010-08-31 19:34:12 UTC
Permalink
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 callsCan you provide a quick pointer on
how to prevent the library from timing out?

Thank you,

-A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20100831/85dbe9bb/attachment.htm
Gaetano Giunta
2010-08-31 20:38:16 UTC
Permalink
Post by Attila
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.
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

bye
Gaetano

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
Post by Attila
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
Attila
2010-08-31 20:56:57 UTC
Permalink
Thanks for your help.

I meant is there anything in the server side of phpxmlrpc that would
time out the request? (Outside of apache/php timeouts)

Thanks
Post by Gaetano Giunta
Post by Attila
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.
How to enable long-lasting method calls
Can you provide a quick pointer on how to prevent the library from timing out?
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
1. use debug level 3 on the phpxmlrpc client
2. use a network sniffer such as Wireshark
bye
Gaetano
ps: for such long-lasting methods, it might be better off to split
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
Post by Attila
Thank you,
-A
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc at lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
--
Sent from my mobile device

Attila
Software Developer
atteeela at gmail.com
Gaetano Giunta
2010-08-31 21:07:27 UTC
Permalink
Post by Attila
Thanks for your help.
I meant is there anything in the server side of phpxmlrpc that would
time out the request? (Outside of apache/php timeouts)
Not that I am aware of ;-)
Post by Attila
Thanks
Post by Gaetano Giunta
Post by Attila
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.
How to enable long-lasting method calls
Can you provide a quick pointer on how to prevent the library from timing out?
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
1. use debug level 3 on the phpxmlrpc client
2. use a network sniffer such as Wireshark
bye
Gaetano
ps: for such long-lasting methods, it might be better off to split
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
Post by Attila
Thank you,
-A
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc at lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
Attila
2010-08-31 21:19:50 UTC
Permalink
Alright, in that case I may be hitting something else.

Ill try a few things and if I find something I will share my results.

Thanks
Post by Gaetano Giunta
Post by Attila
Thanks for your help.
I meant is there anything in the server side of phpxmlrpc that would
time out the request? (Outside of apache/php timeouts)
Not that I am aware of ;-)
Post by Attila
Thanks
Post by Gaetano Giunta
Post by Attila
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.
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
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
1. use debug level 3 on the phpxmlrpc client
2. use a network sniffer such as Wireshark
bye
Gaetano
ps: for such long-lasting methods, it might be better off to split
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
Post by Attila
Thank you,
-A
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc at lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
--
Sent from my mobile device

Attila
Software Developer
atteeela at gmail.com
Continue reading on narkive:
Loading...