DevHeads.net

Postings by Campbell, Lance

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
</IfModule>

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?

Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382

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="http://test.webservices.illinois.edu/bob/calendar/list/7" title="http://test.webservices.illinois.edu/bob/calendar/list/7">http://test.webservices.illinois.edu/bob/calendar/list/7</a>

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

<a href="http://test.webservices.illinois.edu/calendar/list/7" title="http://test.webservices.illinois.edu/calendar/list/7">http://test.webservices.illinois.edu/calendar/list/7</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: acme.com

The following redirects and works as expected:

RewriteCond %{HTTP_USER_AGENT} iPhone.*
RewriteRule ^/index.html
<a href="http://test.webservices.illinois.edu/mobile.html" title="http://test.webservices.illinois.edu/mobile.html">http://test.webservices.illinois.edu/mobile.html</a> [R,L]

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

BUT if I go to <a href="http://acme.com/" title="http://acme.com/">http://acme.com/</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="http://test.webservices.illinois.edu/mobile.html" title="http://test.webservices.illinois.edu/mobile.html">http://test.webservices.illinois.edu/mobile.html</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="http://test.webservices.illinois.edu/calendar/list/%1?skinId=%2" title="http://test.webservices.illinois.edu/calendar/list/%1?skinId=%2">http://test.webservices.illinois.edu/calendar/list/%1?skinId=%2</a>
<http://test.webservices.illinois.edu/calendar/list/%251?skinId=%252>
[L]

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.