I currently have a http server monitor script that I wawnt to improve its memory efficiency. The script spawns 20 threads (using the good old threads, Thread::Queue) each firing a couple of a LWP::UserAgent get (can't use LWP simple as I need to set useragent, among other customized headers). The script costs me around 200MB memory, and I cannot afford any upgrade to my VPS yet. So I really want to know whether there are any better way to thread/fork?
PS, if anyone can show me any articles on how to reduce memory cost for perl scripts, that would be really great. Thanks in advance.