OK, I'm about to design a news posting system with CGI and use one or two external templates. However, I've read 1 or 2 stories that performance will suffer if the server is processing large numbers of pages/scripts. Surely this will be solely dependent on the capability of the server? and if it can hack it then performance wont suffer? Am I right, or talkin arse?
CGI (perl) is not too bad, I have a small forum running a CGI script and it seems ok. ANy reason why you want to stick to CGI when PHP is much nicer to use/work with?
Yeah, CGI is a bit more hardcore, but when you know them both i find CGI a bit more capable. Besides, I find myself using a host with CGI support but no PHP. If you've got it...
Here's the story. The webserver has a parent process that listens to port 80 for requests. The responses are serverd by child processes. A default Apache may have from 15 to 150 of these child processes serving responses, and it can spawn them and reap them to adjust to the load it sees. That's how static pages get served. A CGI request causes an Apache child to fork and exec a new process, to execute the Perl interpreter, shell script, or whatever. The overhead of the fork-and-exec makes CGI perform worse under heavy load than something like PHP running as an Apache module. PHP usually (but not always) runs as a shared object (module) and so communicates with Apache via shared memory. This is much faster than the interprocess communication that occurs in a CGI environment. If you aren't plainning to serve hundreds of requests per second, it probably won't make much difference. (Conversely if you are, it will.) People lose sight of the fact that pages take a long time to render on the client, and go after saving a few tenths of a second execution time on the server when trimming their graphics down or cutting down on tables would yield a much more significant speed boost.
Ah right, Well we're talkin a couple of thousand a day, so from what you've said, it shouldn't really make much difference, nes pas? I'm taking card of both sides (client/server) so that's not a problem.
--------------------------------------------- Oh yeah, it's a WIN2K server, btw. --------------------------------------------- http://www.wehavethewayin.com/ -
Haha, yeah but unless we move hosts, we dont have much choice. Hear about the anti-Linux site recently published by M$. Hosted on a BSD box. roflmfao!! I got CGI scripts runnin locally, btw. I now use Xitami as opposed to IIS and find it much more comfortable.