[Israel.pm] Building a threaded server using Perl?

Yuval Yaari yuval at windax.com
Mon May 31 00:11:47 PDT 2004


semuel wrote:

>Hello There.
>
>My opinion is that select is the best.
>There are servers written around it, that carry huge amount of load.
>It's good when your server does:
>1. Very little processing work for every packet.
>2. NO disk access.
>  
>
All I do is store some data in a hash and if there's new data, I also 
update the database.

>If so, and you program carefully, (even a non-blocking write can block if
>client stopped accepting packets) select is the tool.
>Just remember - if anything blocks, all the server is waiting. So disk
>access can block your entire server.
>And check your platform - there are OSs that have a limit on the number of
>socket that can be used through one select. 
>  
>
Thanks for pointing out on disk-access and such. I think I'll 
Time::HiRes the time it takes for processing each client's data and see 
where I can improve things.
Except for number of open files, I'm not aware of such problems with 
linux - enlighten me if you are.

  --Yuval




More information about the Perl mailing list