unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Guile hangs for minutes when many files are opened (1.8.7)
@ 2011-06-14  7:21 rixed
  2011-06-21 13:02 ` rixed
  2011-07-04  9:33 ` rixed
  0 siblings, 2 replies; 8+ messages in thread
From: rixed @ 2011-06-14  7:21 UTC (permalink / raw)
  To: guile-user

Hello happy hackers!

I'm using guile (1.8.7) to extend an application (written in C) that
writes on many opened file descriptors (usually 5000 files opened at
once).

Amongst other things, guile is listening on a socket to serve user'
commands (kind of embedded REPL).

When many files are opened, guile can be very slow (ie. up to 2 minutes)
to answer connects and/or commands sent to this REPL ; but if I disable
the part of the application that opens and writes into the many files,
then everything goes smooth.

strace revealed me that when pausing, guile is waiting for a lock. There
are some few other guile threads that performs minor activity that may
also use a port (for instance to write a few lines into stdout), but
apart from that guile should be mostly sleeping.

So I've checked libguile/ports.c, looking for what could be affected by
the huge number of opened files, and stumbled upon the port table copy
into a temp port vector in scm_c_port_for_each(), which may hold
scm_i_port_table_mutex for some time if there are as many ports as
opened files descriptor ; but I wonder whether there is an associated
port for a file descriptor that's never used nor even communicated to
guile? Also, I do not call this function myself.

Also, scm_flush_all_ports() is iterating over all ports, but the same
remarks as above apply (I don't call this - although I've found that
really_cleanup_for_exit() does call it - and yet, the 5k file descr
should be unknown of guile).

Do you have any idea of what could cause these pauses?




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-07-04  9:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14  7:21 Guile hangs for minutes when many files are opened (1.8.7) rixed
2011-06-21 13:02 ` rixed
2011-06-21 21:59   ` Ludovic Courtès
2011-06-22  8:34     ` rixed
2011-06-22 12:08       ` rixed
2011-06-22 14:31       ` Ludovic Courtès
2011-06-22 15:56         ` rixed
2011-07-04  9:33 ` rixed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).