PHP vs LC server + 504 Gateway Timeout

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PHP vs LC server + 504 Gateway Timeout

dunbarx via use-livecode
Hi list

On my on-rev account I have a LC script that calls a php script via the
shell, and the php dumps the content of a mySQL db. Then another LC script
(triggered later by another cgi request) builds a zip archive (using
revzip) of the dump + a few small files.
This scripts have been running for years without problem, even if the size
of the db dump was constantly growing.
Then suddenly a couple of days ago, the 2nd script (building the zip
archive) started returning a "504 gateway timeout" error.

As a solution, I modified the 1st script (php) to dump & gzip the db
content in one single pass. And to my surprise, this didn't return any
error, but is also twice faster than the 2nd LC script that was only
zipping the content of the dump.
This was a surprise because I thought that dumping + zipping would be a
heavier task than zipping only, and would take more time...

Any rational explanation for that ?

Thanks in advance
jbv


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: PHP vs LC server + 504 Gateway Timeout

dunbarx via use-livecode
jbv wrote:
 > On my on-rev account I have a LC script that calls a php script via
 > the shell, and the php dumps the content of a mySQL db. Then another
 > LC script (triggered later by another cgi request) builds a zip
 > archive (using revzip) of the dump + a few small files.
 > This scripts have been running for years without problem, even if the
 > size of the db dump was constantly growing.
 > Then suddenly a couple of days ago, the 2nd script (building the zip
 > archive) started returning a "504 gateway timeout" error.
 >
 > As a solution, I modified the 1st script (php) to dump & gzip the db
 > content in one single pass. And to my surprise, this didn't return any
 > error, but is also twice faster than the 2nd LC script that was only
 > zipping the content of the dump.
 > This was a surprise because I thought that dumping + zipping would be
 > a heavier task than zipping only, and would take more time...

Two tasks would seem to take longer than either one of them.

 > Any rational explanation for that ?

If the difference is the language, maybe PHP is dramatically faster than
LC for that task.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode