Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: MySQLdump via Web

by sundialsvc4 (Abbot)
on Aug 12, 2011 at 16:18 UTC ( #920048=note: print w/replies, xml ) Need Help??

in reply to MySQLdump via Web

I think that this is the right place to use a batch-processing system.   The web site would be able to “submit a request” to that system to do this particular thing.   The work itself would be carried out by that system, which would also be responsible for regulating how many such requests could actually be in-progress at any one time.   The web-page (and by extension, the web server) is merely a user interface to getting such things started and/or for monitoring their status.   Said web-server has, and is not given, any direct control over the situation.

Replies are listed 'Best First'.
Re^2: MySQLdump via Web
by armstd (Friar) on Aug 13, 2011 at 02:52 UTC

    ++ on that. When your dump starts taking longer, you'll have to deal with web client timeouts, users getting bored and killing their browser instead of waiting around, network glitches cutting off clients, etc, etc, etc...

    Even if it's just backgrounded... big difference. Initiate request for me, let me know if its done, and possibly give me a way to stop it if its not done.


Re^2: MySQLdump via Web
by chrestomanci (Priest) on Aug 14, 2011 at 18:17 UTC

    ++ to batch processing.

    The way I would do it is to have a simple CGI script on the server that sets a flag to indicate that a dump has been requested by writing an empty file to a certain place. (After checking that the requesting user is authenitcated, and has the right to request a dump.)

    Then have a cron job that runs every few minutes as a more privalaged user. If the flag is present it can do the dump and write it to a location that the web server can read. If there is no flag, or the last dump was to recent then it exits immedately.

    From the end user's point of view the process is to visit a special web page, enter a username and password, then wait 5 minutes or so before downloading the result.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://920048]
[harishnv]: have a question

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2018-02-19 16:14 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (266 votes). Check out past polls.