Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51034 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51041 invoked from network); 15 Dec 2010 16:47:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Dec 2010 16:47:16 -0000 Authentication-Results: pb1.pair.com header.from=doctorrock83@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=doctorrock83@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: doctorrock83@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:60908] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/00-49824-311F80D4 for ; Wed, 15 Dec 2010 11:47:15 -0500 Received: by qyk10 with SMTP id 10so5871209qyk.8 for ; Wed, 15 Dec 2010 08:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=vphSSOh9BlEbLxUcpgLb3LbWGWFKsMm2SISYG9TH/n8=; b=jQQkrPoeDV7bMjnVmOCO0u2gqgsYTDwfHhe2OwZ3NCWRbCVCUZNJFAc+gGdVruaWJ5 21ICvLjnKb4oEa8/A1/wSE9ytVNT4Lb+PhZUqbKZVGD5KbudxwG0pI8lw4vY2buZTIdo zUnRXRqTtETQHXO00xTfhit+EFT3aB6Mi4Pic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=vnYo2XswGcqQJwDQvFe7iwhD8eUPMqnuHEnlR1JOsQoKYPwCoGHh0/eV4eeHsyuO8g wIyINPZy7NupiCOeFDDIROGktIsXnTIjCVZNkjHZ+IEvYWP/A4NhNrc/YSvyXzSnamR8 BubBgXDcxSBdfMQcsUJSEX3KMrs7NcgOc1OCQ= Received: by 10.224.47.130 with SMTP id n2mr6457006qaf.100.1292431632716; Wed, 15 Dec 2010 08:47:12 -0800 (PST) MIME-Version: 1.0 Sender: doctorrock83@gmail.com Received: by 10.220.59.5 with HTTP; Wed, 15 Dec 2010 08:46:32 -0800 (PST) In-Reply-To: References: Date: Wed, 15 Dec 2010 17:46:32 +0100 X-Google-Sender-Auth: 6fm5XIwLTvBdDQtHzGICV2qzbjo Message-ID: To: Jon Davey Cc: jvlad , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: PHP Performance in Apache: Multi-Process vs Multi-Threaded From: jpauli@php.net (Julien Pauli) Well, I can't answer precisely about kernel fork() implementation and possible copy on write mechanisms. May vary across systems. Someone here could answer I suppose. 'top' on httpd process with a prefork mpm gives each child process memory as a whole XxxMb process, but I don't know what kind of memory top sees (and other tools such as 'free'). Anyway, even with a good kernel process COW, threaded systems tend to be less memory hungry than equivalent forked systems. APC uses shared segments with differents tools such as shm, mmap etc... (chosen at compile time). J.Pauli On Wed, Dec 15, 2010 at 12:58 PM, Jon Davey wrote: > 2010/12/15 Julien Pauli >> >> Well, I would say that if your problem is memory, you should consider >> threads as they all share the same memory space in their process. >> >> Apache's children can weight very heavy if PHP's been compiled to >> support lots of extensions, you can happen with ~40/50Mb per process >> which is very huge. Considerating 50 parallel processes eat up 2-3Gb >> for example. >> > > Surely creating a fork of a 50MB process will not consume an > additional 50MB because of copy-on-write virtual memory? I would think > you would only see this growth in memory usage if the extensions > maintained a large payload of data that was being heavily modified in > each request, such as caches, but I expect they create their own > shared memory segments (I have yet to check the source of APC). > > Jon >