I assume that you're talking about the RDS C-ISAM? Well, it
turns out that their ESQL/C product has an undocumented function
called vclose(), which does a virtual close on one of the file
descriptors. I needed it when opening a database, because two
pipes are created to talk to the backend database that gets
forked and exec'ed, and each pipe starts out with two file
descriptors each. By doing two vclose's, I was able to get the
backend created, and in fact didn't even lose efficiency, since
after creating the backend each of the two processes can close
one end of each pipe.
Anyway, to get back to the point, vclose() does some magic to
free up a file descriptor. Supposedly you can call it as many
times as you have tables opened, in an isql context. So, you
might try it with C-ISAM. If you actually need more than 20 file
descriptors, things will run slower, just as if you're running on
virtual memory with a bigger working set than physical memory.
In this case, you get "file descriptor faults", which result in a
close than an open.
I got this info from RDS tech support.