Re: [xml] I/O error : Too many open files



In Solaris 2.6/2.7/2.8 the "FILE" is typedef'ed to "char" thus one can have only 256 opened
FILE objects in one process at any given moment (note that there are also stdin, stderr and
stdout thus the real number is 253 unless you manually close the standard IO streams).
In Solaris 2.9 "FILE" is typedef'ed to "short int" which bumps the limit to 65536. Of course,
there is no way to increase this number because it's hard coded in the OS kernel.

Note, that this limitation applies *only* to the FILE objects (i.e. files opened with fopen()
function). If you use file descriptors and open/read/write/close file functions then you are
limited only by "file descriptors limit" (rlim_fd_cur and rlim_fd_max parameters from /etc/system).

Unfortunately, LibXML2 provides FILE* based API interfaces. Assuming that your program
does close *all* the opened files, there is not much you can do about this except to re-write
either
    1) non-LibXML2 related code and minimize the number of FILE* objects used
or
    2) LibXML2 related code and use memory buffers plus file descriptor based IO functions
    instead of FILE* objects.

Aleksey

Jang, Darryl wrote:
I am using libxml2 and libxslt on this environment:
 
SunOS cbrdeveng5 5.8 Generic_108528-18 sun4u sparc SUNW,Ultra-Enterprise
 
Through my application, I am transforming data with xslt to properly format a message out to a third party.  In normal circumstances my transformations work just fine; my .xsl file is there and globally readable.  However, in high concurrency (40+ threads) I am getting this in STDERR:
 
I/O error : Too many open files
I/O warning : failed to load external entity "/home/djang/codebase/feservertarget/server/data/payment/insert_order_cc_auth.xsl" error
 
I get this error when calling:
 
xsltParseStylesheetFile
 
It returns NULL.  I've looked in the source code briefly, and it's reporting EMFILE from sys/errno.h.  Something within xmlIO.c is NULL.  I am using libxml 2.6.4 and have compiled it --with-threads.  Any insight on this matter would be much appreciated.
 
Thanks much.
 
-- Darryl.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]