logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Unified Configuration File
Author
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Mon 17 Jul '06 20:29    Post subject: Unified Configuration File Reply with quote

Hi all
I'm trying to write a Prefork/woker compatible MPM settings here is what i have:

Code:

# UNIX Compatible
<IfModule !mpm_winnt.c>
    StartServers 2
    ServerLimit 10
    MaxSpareServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
</IfModule>


I'm quite comfortable with the winnt but not with the unix compatible mpm's

These settings shoul work for both Prefork and worker mpm and be able to handle a medium load server 10~15 hosts.

From studieng the documentention it seems to be correct. But please give your opinion on this.


Last edited by Jorge on Mon 17 Jul '06 22:06; edited 1 time in total
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Mon 17 Jul '06 20:47    Post subject: Reply with quote

This is from my 2,2 GHz (AMD) with 1 GB ram and CentOS (Redhat based)

Code:

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>


<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
Back to top
sas



Joined: 17 Jul 2006
Posts: 4
Location: Ohio, USA

PostPosted: Mon 17 Jul '06 20:51    Post subject: reply Reply with quote

I think the maxspareservers is way too low for prefork.

Why don't you just have separate <if> blocks for each mpm? I'm not sure, but Apache might complain about the thread directives when running prefork anyway.

Even if that is accepted, you would have wildly different performance depending on which mpm you ran. Prefork and worker are very different kinds of mpms. On prefork, each server can handle just one request at a time, vs. 25 for worker as you've configured it.

btw, we might be kicked out of here for discussing Unix Wink
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Mon 17 Jul '06 21:53    Post subject: Reply with quote

SAS,

Apache Lounge, although primarily committed to Win environments, is about Apache in general. All flavors of OS are welcome here. Very Happy
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Mon 17 Jul '06 22:05    Post subject: Reply with quote

I'm going with what James Said:
I now have
Code:

# Multi-Processing Module Configuration
# Windows NT
<IfModule mpm_winnt.c>
    ThreadsPerChild 250
    MaxRequestsPerChild  0
    <IfDefine WINFIX>
        #Fix broken AcceptEx (-DWINFIX)
        EnableSendfile Off
        EnableMMAP Off
        Win32DisableAcceptEx
    </IfDefine>
</IfModule>

# UNIX Compatible
<IfModule !mpm_winnt.c>
    #daemon user
    User www
    Group www

    <IfModule prefork.c>
        StartServers       8
        MinSpareServers    5
        MaxSpareServers   20
        ServerLimit      256
        MaxClients       256
        MaxRequestsPerChild  4000
    </IfModule>
    <IfModule worker.c>
        StartServers         2
        MaxClients         150
        MinSpareThreads     25
        MaxSpareThreads     75
        ThreadsPerChild     25
        MaxRequestsPerChild  0
    </IfModule>
</IfModule>

In my platform independed configuration (well with minor edits ^^)

Quote:
btw, we might be kicked out of here for discussing Unix


I'm not really discussing Unix/Linux/Darwin... I asked for an opinion on few lines of configuration directives of apache 2.2...

And IIRC there is nothing in the rules that says I can't post unix related stuff.

Edit: ah pnllan was first... that what you get if you leave the reply windows open for ages.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Mon 17 Jul '06 22:08    Post subject: Reply with quote

LoL Jorge
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Mon 17 Jul '06 22:14    Post subject: Reply with quote

Updateded the tilte a bit and I'll reuse this thread for my next question.
As now is clear i'm working a a configuration that should port easy to my ibook and my Fedora laptop... both have self compiled httpd 2.2 + php + mod_macro

I aim was to only editot the computer name, serverroot and modules to load.

I got most of it working but one think... its probebly because tis not posible but hey No Pain No Gain (Geen Brood Geen Winst :p)

Code:
    # Extended Configuration
    AccessFileName "/hosts/$host/_server/server.conf"
    <Directory "/hosts/$host">
        AllowOverride all
    </Directory>


What i'm tryingto do here:

mydom.com -> /hosts/mydom.com/httpdocs
mydom.com/cgi-bin /host/mydom.com/cgi-bin
...

I got HTTP, HTTPD, DAV working fine...
Now here is the brain breaker:

i want apache to read
/host/mydom.com/_server/server.conf (htaccess file, Overwrite all)
for all request that go to
/host/mydom.com/httpdocs
/host/mydom.com/cgi-bin
/host/mydom.com/httpdocs

Overwrite all
/host/mydom.com

Overwrite Auth Index
/host/mydom.com/httpdocs
/host/mydom.com/cgi-bin
/host/mydom.com/httpdocs

basicly i want to use server.conf
to setup things like php, aliases, proxy to mail server...

I actually starting to dout if its posible...
So here are my option:
1) ditch the Idea all together
2) include the file in host.conf (server needs to restart to add a new host anyway)
3) somehow get this working

I'll probebly go with 2 if 3 isn't posible
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Tue 18 Jul '06 0:09    Post subject: Reply with quote

Update: I've went for the include... since it will be parse when the server is started
Back to top


Reply to topic   Topic: Unified Configuration File View previous topic :: View next topic
Post new topic   Forum Index -> Apache