multithreading - Achieving higher Mbps with every window in Perl -
so hosted website purpose of doing security-tests on it, created script in perl generate 60-72 mbps (info) being sent. noticed if run script multiple times simultaneously generate 150 mbps.
how possible able achieve 150 mbps without need of running script multiple times?
thank you!
you want open multiple tcp connections.
you either need use evented loop handle back-and-forth of keeping pipes full, or need use threads/processes. commented above, can use 'fork' make multiple copies of script, each 1 can make 1 tcp connection , keep connection full. that's simple solution.
if want keep program single process, it's bit more work, still possible.
if opening lot of connections, you'll want read this: http://www.kegel.com/c10k.html
you might consider using faster language c or go, since using perl involve overhead. (i'd test first, maybe overhead negligible. test using tool curl
send big file see if gets higher bandwidth perl program.)
Comments
Post a Comment