Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Need Fast LWP GET

by perlfan (Vicar)
on Jun 13, 2020 at 04:17 UTC ( [id://11118009]=note: print w/replies, xml ) Need Help??


in reply to Need Fast LWP GET

This is generally handled by using fork. But if you don't watch how many children you're creating, you will fork bomb your system. I've found Parallel::ForkManager is a really nice, unobstrusive layer above fork that provides pretty much what you're going to need. That said, there are a variety of async modules out there; but I am pretty sure they all fork under the hood since Perl doesn't support threads unless they've written some fancy pthreaded XS backends (which maybe some have).

Replies are listed 'Best First'.
Re^2: Need Fast LWP GET
by bobinyec (Acolyte) on Jun 13, 2020 at 11:14 UTC
    Thank you to all who responded.

    Manipulating STDOUT and STDERR with CLOSE/OPEN didn't work.

    I'm trying to do this on a commercial web hosting service so I don't have access to the more non-mainstream solutions mentioned.

    Fortunately, the target process of the LWP isn't intolerably long, so the situation is acceptable.

    jb

      I think you also have to close STDIN, perhaps depending on which web server is being used.

        Bingo! Closing STDIN as well, worked!

        Thanks!

        jb

      I'm trying to do this on a commercial web hosting service so I don't have access to the more non-mainstream solutions mentioned.

      Please see Yes, even you can use CPAN - if you have shell access to the machine, it's very likely you can install modules there, using something like local::lib, and sometimes it's possible even if you don't have shell access. Personally I'd prefer to help you with that rather than some other hacked solution :-)

      There is perlbrew. Also a VM on digital ocean is $5/mo, which provides a nice companion to any share hosting account environment. Those are not suitable for the kind of shell home you want. Also check out SDF/freeshell.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found