In <
28eb8c24-ce2f-48f3...@googlegroups.com>, on 08/19/21
at 03:25 AM, David McKenna <
davidmc...@gmail.com> said:
Hi David,
>while, shared high memory (according to mem /v) was at only 92M (on a
>4GB machine). Not clear to me what is using up memory. If I stop apache
>all memory is returned, so a restart clears it. Maybe a settings issue
>- need to investigate more...
This is a known issue and it's not limited to the OS/2 platform. All the
mpm modues support configuration variables to deal with this. For our mpm
module, the usual fix is to restart the worker processes after some number
of requests.
The main source of memory usage is memory fragmentation. The apache heap
is based on pools which miminizes true leaks. Pools help avoid
fragmentation, but do not eliminate it.
That said, if a transaction manages to terminate without releasing its
pool, there will be leaks. If you can identify specfic instances where
this occurs, tickets would be good.
Here's an annotated httpd-mpm.conf from one of my test setups.
extra\httpd-mpm.conf:92
# OS/2 MPM
# StartServers: Number of server processes to maintain
# MinSpareThreads: Minimum number of idle threads per process, #
to handle request spikes
# MaxSpareThreads: Maximum number of idle threads per process #
MaxRequestsPerChild: Maximum number of connections per server process #
MaxConnectionsPerChild: Maximum number of connections per server process
<IfModule mpm_mpmt_os2_module>
# default ap_thread_stack_size is 128 * 1024 (128K) asof 2013-03-09
ThreadStackSize 131024
# DEFAULT_START_DAEMON is 2 as of 2014-12-22 SHL
# 2020-02-12 SHL FIXME debug
# StartServers 2
StartServers 1
# DEFAULT_MIN_SPARE_THREAD is 5 as of 2014-12-22 SHL
# MinSpareThreads 5
MinSpareThreads 1
# DEFAULT_MAX_SPARE_THREAD is 10 as of 2014-12-22 SHL
# MaxSpareThreads 10
MaxSpareThreads 1
# ap_max_requests_per_child initialized to 0
# 2015-01-05 SHL Updated
# MaxRequestsPerChild 1000
# 2019-08-18 SHL Sync with 2.24 renames
# MaxConnectionsPerChild 1000
# 2019-11-06 SHL FIXME to be gone - testing
MaxConnectionsPerChild 5
</IfModule>
This setup is used for debugging, so threads and servers are purposely
limited so that I can debug the worker process with idebug.
A more typical production setup is:
extra\httpd-mpm.conf:100
<IfModule mpm_mpmt_os2_module>
ThreadStackSize 65536
StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxConnectionsPerChild 1000
</IfModule>
To tune these values for your mix, you can use apache's ab.exe. There's
also the siege tool. We used this extensively to stabilize 2.2. Paul's
build is at
http://smedley.id.au/tmp/siege-3.0.9-os2-20141231.zip
The current release is 3.14. The changelog does not show any updates that
we really need.
Steven
--
----------------------------------------------------------------------
"Steven Levine" <
ste...@earthlink.net> Warp/DIY/BlueLion etc.
www.scoug.com www.arcanoae.com www.warpcave.com
----------------------------------------------------------------------