freebsd at anjos.strangled.net
Wed Apr 26 17:08:33 UTC 2006
Qua, 2006-04-26 às 12:07 -0300, Pgold escreveu:
> Hi, I´m developing a web app in C++. But it loads a huge amount of
> from a Database to memory, and I can´t afford doing this everytime
> someone asks for the page. Is there a way to make the program to keep
> running, and reading requests made via CGI?
> If it helps, i´m running FreeBSD 6.0 with Apache 2.2.
If the problem is keeping the data in memory, I don't think even
mod_perl or mod_python will help you.
- write an apache module; that will be always in memory. I'm not sure if
it will be hard to compile.
- forget about C++ and use mod_mysql or whatever is available for your
- split your web app in two parts: cgi scripts (or apache module) and a
server app that keeps data in memory and responds to requests made by
cgi scripts. Communication between the two can be made with pipes,
sockets, shared memory or whatever you like.
- load less data from the database; only that which you need to generate
output. (For example, for an SQL database, use WITH, HAVING, OFFSET and
Any more sugestions?
More information about the freebsd-questions