Postings by Campbell, Lance

Enhancement Request

MPM Workers


Please change your worker parameter naming convention in regards to MAX.






Why? I completely misunderstood the difference between ThreadLimit and ThreadsPerChild. I have wasted over 8 hours researching the difference.

Try this out:

ThreadsPerChild 32

MaxThreadsPerChild 40

It is obvious what the relationship is between parameters with and without the prefix “max”. Compare these ThreadLimit and ThreadsPerChild.

MPM worker - ThreadLimit and ThreadsPerChild

Apache 2.4
MPM Worker
The relationship between ThreadLimit and ThreadsPerChild is not very clear. These are some questions I have.

1. Why would you ever want ThreadLimit bigger than ThreadsPerChild?
2. If you do want it bigger then how do you determine how much bigger it should be?


With the below settings apache crashed on me. The error log told me it reached MaxRequestWorkers. It suggested increasing the size. To remedy the situation I increased MaxRequestWorkers to 10,0000. Then I was fine. Based on the documentation it says that you are supposed to divide the MaxRequestWorkers by ThreadsPerChild to get to ServerLimit. I don’t recall how many running processes I had at the time of the crash. I was in a panic mode. I have not had apache crash on me in so long I was not really prepared.

Apache 2.4 order mpm issue

Apache 2.4
CentOS 7
Apache has numerous times today hung on me.

Apache 2.4 worker mpm memory climbing no new processes

Apache 2.4
Worker MPM

I am using this configuration for Worker MPM:

<IfModule mpm_worker_module>
ServerLimit 90
StartServers 10
MaxRequestWorkers 2048
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25

Apache has created 12 processes. Apaches memory consumption slowly increases but never goes down. Currently Apache is using 423M and the average Process size is 35.3M. When I look at the Apache access log I see an enormous number of requests coming across my terminal. Should I change my settings?

monitoring suggestions

This PostgreSQL instance is used for dynamic web content. It runs on a dedicated server.

So I need some PostgreSQL monitoring advice. There are two basic strategies that I am aware of for configuring PostgreSQL:

1) In Memory: With an in memory option you give PostgreSQL 70% or more of the memory by setting the shared buffers. You are relying on PostgreSQL to put into memory the information within the database. The only access to the disk from my understanding should be for the initial read of data into a block of memory and when updates are made to data blocks.

Tablespaces on a raid configuration

PostgreSQL 9.0.x
When PostgreSQL storage is using a relatively large raid 5 or 6 array is there any value in having your tables distributed across multiple tablespaces if those tablespaces will exists on the same raid array? I understand the value if you were to have the tablespaces on different raid arrays. But what about on the same one?


Lance Campbell
Software Architect
Web Services at Public Affairs

database slowdown while a lot of inserts occur

PostgreSQL 9.0.x
We have around ten different applications that use the same database. When one particular application is active it does an enormous number of inserts. Each insert is very small. During this time the database seems to slow down in general.

URL rewrite rule not working the way I thought it should

I have a URL:

<a href="" title=""></a>

I want to rewrite the URL internally so apache sees it as the following tomcat mod_jk URL:

<a href="" title=""></a>

BUT I don't want to redirect. I want apache to see the URL internally as the above. So the URL in the persons browser still show "bob".

I used the below RewriteRule but it gives me a 404:

RewriteRule ^/bob/calendar/(.*) /calendar/$1 [L]

If I change the rule to the below it then works but the URL in the browser is changed to exclude "bob".

cannot get RewriteRule for just the document root to work

Assume my site is:

The following redirects and works as expected:

RewriteCond %{HTTP_USER_AGENT} iPhone.*
RewriteRule ^/index.html
<a href="" title=""></a> [R,L]

So if I go to <a href="" title=""></a> it redirects me to the
mobile.html page.

BUT if I go to <a href="" title=""></a> it does not redirect me.

So I thought the following would work but it does NOT:

RewriteCond %{HTTP_USER_AGENT} iPhone.*
RewriteRule ^/ <a href="" title=""></a> [R,L]

How do I get just the base root to redirect?

RewriteCond how to set variable

I have the following RewriteCond. I put numbers in front of each line
for reference:

1) RewriteCond %{QUERY_STRING} !XSL=NONE [NC]

2) RewriteCond %{QUERY_STRING} calId=([0-9]+) [NC]

3) RewriteCond %{QUERY_STRING} skinId=([0-9]+) [NC]

4) RewriteRule ^/calendar
<a href="" title=""></a>

I just learned that when you use %1 and %2 in line 4 it will only
reference the last RewriteCond. So in line 4 the %1 comes from line 3
but the %2 is blank.