Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Apparent memory leak on 64bit windows / php / mysql stack |
|
Author |
|
choddo
Joined: 06 Mar 2016 Posts: 2
|
Posted: Tue 05 Apr '16 23:16 Post subject: Apparent memory leak on 64bit windows / php / mysql stack |
|
|
Hi
We run a moderately busy web forum - 300-400 concurrent users - and are losing about 500MB of RAM per hour, consumed by the httpd child process. We have to recycle Apache two or three times a day to avoid running out of RAM.
OS is Win2008 R2
We were using a 32bit Apache 2.2 stack with php 5.3.20 and we never used to get this problem.
I upgraded to this;
Apache 2.4.18 (using 2 Mar build) x64 VC11
php 5.3.20 x64 using the apache module
MySQL 5.7
Invision powerboard 4.1.19
The most likely culprit seems to be php since 64bit version of 5.x is only "experimental" but php7 isn't yet supported by Invision.
Can anyone suggest a way we can pin down what is refusing to release memory? |
|
Back to top |
|
daniel1975
Joined: 05 Feb 2006 Posts: 24 Location: RO, Bucharest
|
Posted: Wed 06 Apr '16 8:40 Post subject: Re: Apparent memory leak on 64bit windows / php / mysql stac |
|
|
I am presuming the PHP version is 5.6.20 and not 5.3.20 which probably has been a typo. I would suggest to switch to use mod_fcgid for PHP usage as I do have same OS and combination and using mod_fcgid I have no memory leak issue. |
|
Back to top |
|
choddo
Joined: 06 Mar 2016 Posts: 2
|
Posted: Wed 06 Apr '16 20:49 Post subject: |
|
|
Hi - thanks for the suggestion.
Indeed, it's 5.6.20
Unfortunately, running under FastCGI, the problem actually got worse, it leaked memory about 50% faster!
Would you be able to share which extensions you have loaded on your server? We only have a limited set;
curl
openSSL
gd2
mbstring
mysqli
and I just tonight enabled zend opcache, to try to reduce some CPU load. |
|
Back to top |
|
daniel1975
Joined: 05 Feb 2006 Posts: 24 Location: RO, Bucharest
|
Posted: Thu 07 Apr '16 13:57 Post subject: |
|
|
In Apache I have mod_fcgid, mod_ssl, mod_security2, and mod_svn. In PHP I do have quite a few extensions active like: bz2, curl, fileinfo, gd2, intl, ldap, mbstring, exif, mysli, openssl, pdo_mysql, sockets, xsl.
So, any chance you might have persistent mysql connections implemented that are left hanging on? Or even curl_exec or curl_multi_exec without a proper close? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 07 Apr '16 16:26 Post subject: |
|
|
Which download from windows.php.net did you use? |
|
Back to top |
|
daniel1975
Joined: 05 Feb 2006 Posts: 24 Location: RO, Bucharest
|
Posted: Fri 08 Apr '16 23:46 Post subject: |
|
|
James Blond wrote: | Which download from windows.php.net did you use? |
Having a config with mod_fcgid it is the NTS version, of course, and more precisely 5.6 on port 80 and 7.0 on port 443, both 64 bit. |
|
Back to top |
|
daniel1975
Joined: 05 Feb 2006 Posts: 24 Location: RO, Bucharest
|
Posted: Wed 13 Apr '16 23:25 Post subject: |
|
|
choddo wrote: | Hi - thanks for the suggestion.
Indeed, it's 5.6.20
Unfortunately, running under FastCGI, the problem actually got worse, it leaked memory about 50% faster!
Would you be able to share which extensions you have loaded on your server? We only have a limited set;
curl
openSSL
gd2
mbstring
mysqli
and I just tonight enabled zend opcache, to try to reduce some CPU load. |
I am just curios if your memory leaks problems got solved and if you were able to determine the relevant root cause and able to share with us? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 18 Apr '16 11:40 Post subject: |
|
|
Well on some windows installations I hvae to use the TS version instead of NTS cause the NTS crashed the server even through fcgid. I never figured out why. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Wed 20 Apr '16 8:58 Post subject: |
|
|
choddo wrote: | Indeed, it's 5.6.20
Unfortunately, running under FastCGI, the problem actually got worse, it leaked memory about 50% faster! | Under mod_fcgid, you can determine which component is leaking memory because httpd and php-cgi are shown separately in the task manager. Which one is it? Are there multiple php-cgi instances in the task manager? Do they grow over time in number and/or in size per instance?
Try running the 32 bits NTS version under mod_fcgid. It is more mature than the 64 bits version and might even be the fastest of the 4 choices (TS/NTS * 32/64) you have. |
|
Back to top |
|
|
|
|
|
|