libpurple in server

Ethan Blanton elb at pidgin.im
Fri Jun 1 01:26:31 EDT 2007


Christopher Baus spake unto us the following wisdom:
> I'm currently working on such a project.  I think the only potential issue
> is handling the single threaded event loop in a scalable manner.  For
> instance doing I/O when handling messages is going to block the entire
> glib event distribution until the I/O completes.  This will result in poor
> CPU and I/O utilization.

So, while this is true at some level, you should be able to handle an
awful lot of IM connections before this becomes a problem.  Most of
your I/O will be simple buffer reads and writes, and the only real
cost you'll pay is the system call overhead.  (Disk I/O in libpurple
is about the only thing which might degenerate into something other
than a buffer read or write, as it is blocking.)

If you're wanting to serve thousands of IM accounts at the same time,
you'll certainly have to do something about this ... if you're wanting
to serve dozens or hundreds (for a small company or school, say), I
doubt this will become a problem.  Threads are not necessary nearly as
often as people like to think.  :-)

Ethan

-- 
The laws that forbid the carrying of arms are laws [that have no remedy
for evils].  They disarm only those who are neither inclined nor
determined to commit crimes.
		-- Cesare Beccaria, "On Crimes and Punishments", 1764
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20070601/0e686991/attachment.sig>


More information about the Devel mailing list