Run Script As Daemon

Separate the script from the web server process and thus rid ourselves of the overhead of reading in the db/index(es) every time a page is loaded. (mod_perl is another way to do this)

Does this mean using FastCgi?

No, mod_perl and FastCgi are two different ways of avoiding creating a process for each hit. mod_perl works by basically loading your Perl program into the Apache process that serves the pages, while FastCgi is a way to have an external process serve more than a single page, so that you amortize the cost of the process creation over a bunch of pages.

The anecdotal evidence I've heard about FastCgi is that it's pretty complex and decreases robustness.

If you really want robustness, try rewriting Wiki as an Apache C module. That's what I did for Advogato, and the scalability is just delicious - it gets SlashDotted on a regular basis without seriously affecting the load on the server, and all the content on the site is dynamically rendered from an XmlDatabase. -- RaphLevien [On the other hand, SlashDot itself is written using mod_perl. --anon]

Do you just have a large XML file, or are you actually using one of the new XmlDatabaseServers that are out?

It lives in the filesystem, but as a bunch of smaller files, not as one big one. From a programming point of view, there is an abstraction layer that hides the implementation. I thought about using BerkeleyDb?, but for now am more than happy with the performance of the filesystem-based approach. And, it's simple! -- RaphLevien


The current WikiWikiGoesPublic version of Wiki is not terribly mod_perl-friendly, since it is largely perl4ish, and uses a lot of global variables, which generally translate to problems in fcgi or mod_perl. I am looking at doing a mod_perl-friendly version of WikiWiki, FWIW, although mainly because it might be fun, rather than for any (other) good reason! -- HowardJones

If you're looking to write a mod_perl friendly wiki, you might want to check out UseModWiki. It also has lots of global variables, but they are all pre-declared, and most of them are initialized on every request.

---

I strongly recommend mod_perl. The whole http://virtualschool.edu/98c website is based on it. I've only good things to say about mod_perl (for perl) and jserv (for java). Switched from perl to java for http://superdistributed.com. BradCox


... or mod_python for the enlightened ;-). http://www.modpython.org/.

If your script is written in python, you can try mod_python for simple stuff, or WebwareForPython or ZopeApplicationServer for more complex stuff. If you use either of these last two, you will certainly want to investigate PoundReverseProxy.

-- TerrelShumway

PoundReverseProxy is not python-specific. It was written for Zope, but works with any HTTP server.


EditText of this page (last edited December 22, 2007) or FindPage with title or text search