Configure RLimitMEM, RlimitCPU in Apache server

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Configure RLimitMEM, RlimitCPU in Apache server

Postby trantuangtvt » 15. March 2011 04:23

Hi all,

Please support me!

I am using XAMPP 1.6.4 Win 32 installer to install XAMPP in Win server 2008 64bit. We have a problem with memory of server so I need to change RLimitMEM and RLimitCPU variables. But we don't know where they are and how to change those. Could you show me name of file which is keeping and how to modify them

my apache version is 2.2.6

Thanks for your support

Tuan
trantuangtvt
 
Posts: 2
Joined: 15. March 2011 03:59

Re: Configure RLimitMEM, RlimitCPU in Apache server

Postby Sharley » 15. March 2011 05:45

This does not work in XAMPP on Windows platforms as it is purely for Linux platforms.


I have just checked using a slightly newer XAMPP version than 1.6.4 by following this method below:

Make sure that this entry in the \xampp\apache\conf\httpd.conf file is uncommented so it looks like this
Code: Select all
LoadModule bw_module modules/mod_bw.so


Then add this block entry at the end of the httpd.conf file like so
Code: Select all
<IfModule bw_module>
RLimitCPU 60
RLimitMEM 256000
</IfModule>
Save the file and restart Apache.
Read your \xampp\apache\logs\error.log file after starting Apache and you should see entries like this
Code: Select all
[Tue Mar 15 14:18:28 2011] [error] RLimitCPU not supported on this platform
[Tue Mar 15 14:18:28 2011] [error] RLimitMEM not supported on this platform
Which would seem that nothing has changed for these directives in Windows.

Similar example here:
http://community.spiceworks.com/topic/115589

Docs here:
http://httpd.apache.org/docs/current/mo ... #rlimitcpu
http://httpd.apache.org/docs/current/mo ... #rlimitmem




Multi-Processing Modules (MPMs)
There are some entries in the \xampp\apache\conf\extra\httpd-mpm.conf file under the section WinNT MPM that may be of use with performance issues - the other entries are for different systems.

List of Directives for WinNT MPM here:
http://httpd.apache.org/docs/current/mod/mpm_winnt.html



You should add this Directive at the end of the httpd.conf file, if it is not already included
Code: Select all
Win32DisableAcceptEx
which may also help performance - see the above docs.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Configure RLimitMEM, RlimitCPU in Apache server

Postby trantuangtvt » 15. March 2011 08:43

hi Sharley,

Thanks for your reply. I try to research about that but I still not find my answer...

this is my issue:

FATAL: erealloc(): Unable to allocate 468538 bytes
[Mon Mar 14 14:32:20 2011] [notice] Parent: child process exited with status 1 -- Restarting.
[Mon Mar 14 14:32:20 2011] [notice] Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8e mod_autoindex_color configured -- resuming normal operations
[Mon Mar 14 14:32:20 2011] [notice] Server built: Sep 21 2007 00:29:38
[Mon Mar 14 14:32:20 2011] [notice] Parent: Created child process 2692
[Mon Mar 14 14:32:22 2011] [notice] Child 2692: Child process is running
[Mon Mar 14 14:32:22 2011] [notice] Child 2692: Acquired the start mutex.
[Mon Mar 14 14:32:22 2011] [notice] Child 2692: Starting 250 worker threads.
[Mon Mar 14 14:32:22 2011] [notice] Child 2692: Starting thread to listen on port 443.
[Mon Mar 14 14:32:22 2011] [notice] Child 2692: Starting thread to listen on port 8080.

My apache server of XAMPP is restarted automaticaly after 3-5 minutes. Some guys show me to change number of threads to smaller and I also try to set the current number of thread is 70 ( default 250) but the issue is still happening. Do you have any idea to fix "FATAL: erealloc():" error. I know that it is difficult to fix .... not only me but also a lot of guys have faced it in case they use XAMPP
trantuangtvt
 
Posts: 2
Joined: 15. March 2011 03:59

Re: Configure RLimitMEM, RlimitCPU in Apache server

Postby Sharley » 15. March 2011 08:58

Find all instances of
Code: Select all
Win32DisableAcceptEx

Comment it out so it looks like this
Code: Select all
#Win32DisableAcceptEx
Save the configuration files you find it in and then restart Apache and see if the error returns in the error.log file again.

Also I see that increasing the Windows swap file may help if the above fails.

Finally if all else fails then uninstall XAMPP 1.6.4 - readme_en.txt file has instructions for uninstalling - don't forget to make a copy of your own files and data.

Download and install version 1.6.8 as I find that version quite stable.
Download 1.6.8 from here.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Configure RLimitMEM, RlimitCPU in Apache server

Postby Sharley » 15. March 2011 23:53

You can also try this fix from the FAQ if you are still having memory issues:
http://www.apachefriends.org/en/faq-xam ... tml#memory
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: Flexnood and 123 guests