The select() limit has nothing to do with sqlite.  You already noted it's a 
limit on sockets -- it's really an OS limit.  Do you have any idea what your 
max is or what you think you need?
 
I see some solutions and upcoming problems (by the way, you forgot to mention 
what OS you're on).
 
#1 You're apparently handling your socket connections all from the same 
executing binary.  Just give each client their own executable and you won't hit 
that limit.  Two ways to do that are to fork() and also to spawn the executable 
uniquely for each client (so you don't run a server process -- you let xinetd 
do it for you so you get one process per socket.
 
#2 Use poll() instead of select().  poll() doesnt have the 1024 limit.
 
 
 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of Pavel Ivanov
Sent: Fri 5/7/2010 3:43 PM
To: General Discussion of SQLite Database
Subject: [sqlite] Changing file descriptor of database file



Hi, all!

I'm writing a server application that uses SQLite database as a
storage. In fact for various reasons I use a lot of SQLite database
files at once. This application can serve hundreds of clients spread
all over the network. Communication with those clients goes over
non-blocking sockets and currently select() is used to listen for
events in those sockets. select() has limitation that it can be used
only with file descriptors less than 1024. On a heavy loaded server my
application can easily run out of those 1024 file descriptors which
will mean that it will no longer accept connections from new clients.
To avoid such situation or at least to make possibility of such event
less I'd like to force SQLite to open databases with file descriptors
greater than 1024. Is there a way how I can do that without patching
SQLite sources and maintaining this patch over SQLite updates?


Pavel
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to