Speeding up UserGent LWP creation

I need to execute a large number of HTTP message requests and ignore the response. I am currently doing this using LWP :: UserAgent. It seems to be working a bit slower, although I'm not sure if he is waiting for an answer or that, is there any way to speed it up and maybe just ignore the answers?

+3
source share
2 answers

Bigian's answer is probably the best for this, but another way to speed things up is to use LWP :: ConnCache to allow LWP to reuse existing connections, rather than creating a new connection for each request.

Enabling this is simple if you only knock on one site -

my $conn_cache = LWP::ConnCache->new;
$conn_cache->total_capacity([1]) ;
$ua->conn_cache($conn_cache) ;

, http- https.

+3

LWP:: Parallel

http://metacpan.org/pod/LWP::Parallel

"

ParallelUserAgent libwww. URL- ( URL- HTTP, FTP FILE. HTTPS) , .

, ...

+2

Source: https://habr.com/ru/post/1722031/


All Articles