From apache at lmem.icsurselva.ch Thu Sep 25 17:29:42 2008 From: apache at lmem.icsurselva.ch (Valentin Schmid - ICSurselva AG) Date: Thu, 25 Sep 2008 17:29:42 +0200 (CEST) Subject: [mpm-itk] Feature Request Message-ID: <3087110a4c4e0a0375f8b5abaf172561.squirrel@admin.mail1.icsurselva.ch> Hello, Here's my Problem: http://marc.info/?l=php-install&m=122233435625755&w=2 Because there's no Solution for this Problem in php, I thought it would be wise to do this in the mpm. Would it be possible to add the following Process Limits per Virtualhost: Limit the CPU consumption of the processes in this VHost (e.g. via Configuration variable RLimitCPUVHost) Limits the memory consumption of the processes in this VHost (e.g. via Configuration variable RLimitMEMVHost) I think this could be done like this... In the file server/mpm/experimental/itk/itk.c procedure itk_post_read: Add the following lines: ... #ifdef RLIMIT_CPU if (sconf->rlimit_cpu_vhost != NULL) { if ((setrlimit(RLIMIT_CPU, rlimit_cpu_vhost)) != 0) { return an error; } } #endif #if defined(RLIMIT_AS) if (sconf->rlimit_mem_vhost != NULL) { if ((setrlimit(RLIMIT_AS, sconf->rlimit_mem_vhost)) != 0) { return an error; } } #elif defined(RLIMIT_DATA) if (sconf->rlimit_mem_vhost != NULL) { if ((setrlimit(RLIMIT_DATA, sconf->rlimit_mem_vhost)) != 0) { return an error; } } #elif defined(RLIMIT_VMEM) if (sconf->rlimit_mem_vhost != NULL) { if ((setrlimit(RLIMIT_VMEM, sconf->rlimit_mem_vhost)) != 0) { return an error; } } #endif ... From sgunderson at bigfoot.com Fri Sep 26 13:35:22 2008 From: sgunderson at bigfoot.com (Steinar H. Gunderson) Date: Fri, 26 Sep 2008 13:35:22 +0200 Subject: [mpm-itk] Feature Request In-Reply-To: <3087110a4c4e0a0375f8b5abaf172561.squirrel@admin.mail1.icsurselva.ch> References: <3087110a4c4e0a0375f8b5abaf172561.squirrel@admin.mail1.icsurselva.ch> Message-ID: <20080926113522.GB19978@uio.no> On Thu, Sep 25, 2008 at 05:29:42PM +0200, Valentin Schmid - ICSurselva AG wrote: > Here's my Problem: > http://marc.info/?l=php-install&m=122233435625755&w=2 > Because there's no Solution for this Problem in php, I thought > it would be wise to do this in the mpm. The MPM is probably not the right place for this -- it sounds like something you could do in a separate Apache module. I don't know PHP, though, so I cannot say anything about your specific case. /* Steinar */ -- Homepage: http://www.sesse.net/ From apache at lmem.icsurselva.ch Fri Sep 26 23:46:53 2008 From: apache at lmem.icsurselva.ch (Valentin Schmid - ICSurselva AG) Date: Fri, 26 Sep 2008 23:46:53 +0200 (CEST) Subject: [mpm-itk] Feature Request In-Reply-To: <20080926113522.GB19978@uio.no> References: <3087110a4c4e0a0375f8b5abaf172561.squirrel@admin.mail1.icsurselva.ch> <20080926113522.GB19978@uio.no> Message-ID: Hello Steinar, Thanks for your answer. > The MPM is probably not the right place for this -- it sounds like > something you could do in a separate Apache module. You're probably right. I just found something like that what I need: http://www.ucc.asn.au/~dagobah/things/mod_rlimit.c (Unfortunately only for apache 1.3) There's also an apache core patch with this issue: http://archives.neohapsis.com/archives/openbsd/2005-12/1436.html Kind regards valli