Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Download big file in chunks with plack response

by Thenothing (Acolyte)
on Apr 22, 2021 at 16:58 UTC ( #11131605=note: print w/replies, xml ) Need Help??


in reply to Re^2: Download big file in chunks with plack response
in thread Download big file in chunks with plack response

Hi, yes I did that before to run.
  • Comment on Re^3: Download big file in chunks with plack response

Replies are listed 'Best First'.
Re^4: Download big file in chunks with plack response
by kikuchiyo (Friar) on Apr 23, 2021 at 18:04 UTC
    What is the exact code that you're running, with which server, and how big is the file you're trying to serve (and how much memory do you have in the machine/VM/smart fridge you're trying this on)?
      First thank you for your participation, The code I posted is all I have, the server is HTTP::Server::PSGI, the memory I have is 1.5gb, the file is a iso of 2.30 GB, the code is running in virtual machine VMware Workstation

        I can't reproduce.

        I've created a 2 GB file with dd, hardcoded its name in my script in Re: Download big file in chunks with plack response, executed ulimit -v 1000000 to limit available memory, then in the same shell ran the server as plackup script.pl. From a different terminal I've then ran curl http://localhost:5000 -o /tmp/thing.

        Predictably, the server died with "Out of memory". Then, I've commented out the slurp line, as I've suggested earlier. Predictably, the server proceeded to serve the file and didn't die.

        What are you actually doing, and what is your exact error message?

        (I had to add a line \&return_psgi; for it to work with plackup, and I hardcoded the file name because I'm not aware of a way for a PSGI a handler to get a file name as an argument, so I suspect there is something else in the picture that you're not telling us.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131605]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2022-09-28 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?