Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7412 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76072 invoked by uid 1010); 30 Jan 2004 07:51:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76021 invoked from network); 30 Jan 2004 07:51:39 -0000 Received: from unknown (HELO fresh.co.il) (192.117.122.113) by pb1.pair.com with SMTP; 30 Jan 2004 07:51:39 -0000 Received: from localhost (shimi@localhost) by fresh.co.il (8.11.6/8.11.6) with ESMTP id i0U7pbO12304; Fri, 30 Jan 2004 09:51:37 +0200 Date: Fri, 30 Jan 2004 09:51:37 +0200 (IST) X-X-Sender: shimi@fresh.co.il To: "ashish b\\" cc: internals@lists.php.net, , , In-Reply-To: <20040130072420.74549.qmail@web60508.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Apache + PHP extension modules + Prefork MPM From: shimi@shimi.net (shimi) References: <20040130072420.74549.qmail@web60508.mail.yahoo.com> On Thu, 29 Jan 2004, ashish b\ wrote: > Hello , > I have Apache compiled for Prefork MPM and PHP as Loadable module > on Redhat LINUX 7.3. > 1. I have a PHP extension module which is added in the "extension=mymodule.so" > directive of php.ini. > 2. Now when Apache starts it will load the PHP module, which in turn will load the > PHP extension "mymodule.so". mymodule.so is in turn calling functions from another > library called "myfunctions.so" and is linked with it during compilation.So the > path of function calls is Apache -> libphp4.so -> mymodule.so -> myfunctions.so > 3. I have a "test.php" script which calls functions from the extension module. > 4. If I run the script paralelly from 200 browsers then new httpd processes will be > spawned due to the load. > My question is that : > Will these newly created httpd processes reload the extension module mymodule.so and myfunctions.so for themselves OR use the extension module which was loaded during startup of the Apache server ? What will happen in case of CGI? > Thanks & Regards > Ashish > I believe prefork, as its name implies, uses the fork() system call to spawn child processes. That means that it is generation an EXACT copy of the calling process in the memory, and just resuming operation from the point fork() was called. Hence when forking, every child will be a completely identical copy of the original process, no matter what was loaded in the memory space. As per CGI, in CGI the PHP *interperter* is spawned (via execv() I guess) by apache, which means everything is reloaded back from the block device per every child process loaded (=slower...) I could be wrong, though :-) > > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free web site building tool. Try it! -- Best regards, Shimi ---- "Outlook is a massive flaming horrid blatant security violation, which also happens to be a mail reader." -=The best way to accelerate a Windows machine is at 9.81 m/s^2=- "Windows is a 32-bit port of a 16-bit GUI for an 8-bit OS on a 4-bit CPU made by a 2-bit company that can't stand 1 bit of competition."