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.
> 
> Greets,
> Pedro.

If the problem is keeping the data in memory, I don't think even
mod_perl or mod_python will help you.

Sugestion #1
- write an apache module; that will be always in memory. I'm not sure if
it will be hard to compile.

Sugestion #2
- forget about C++ and use mod_mysql or whatever is available for your
DBMS.

Sugestion #3
- 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.

Sugestion #4
- 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
LIMIT wisely).

Any more sugestions?

--
Miguel

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to