I’ve written a simple perl script that I’m running via fastCGI on Apache. The application loads a set of XML data files which are used to lookup values based upon the the query parameters of an incoming request. As I understand it, if I want to increase the amount of concurrent requests my application can handle I need to allow fastCGI to spawn multiple processes. Will each of these processes have to hold duplicate copies of the XML data in memory? Is there a way to set things up so that I can have one copy of the XML data loaded in memory while increasing the capacity to handle concurrent requests?
Share
As pilcrow correctly answered, FastCGI provides no special way to share data between processes and lists traditional ways to reduce memory usage.
One additional possibility is to have a persistent, non-FastCGI process read the XML file and act as a data server for the FastCGI processes. The efficiency of this depends on how complicated the queries are and how much data needs to be passed in and out, but it would allow a single copy of the data to remain in memory.