logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apparent memory leak on 64bit windows / php / mysql stack
Author
choddo



Joined: 06 Mar 2016
Posts: 2

PostPosted: Tue 05 Apr '16 23:16    Post subject: Apparent memory leak on 64bit windows / php / mysql stack Reply with quote

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

PostPosted: Wed 06 Apr '16 8:40    Post subject: Re: Apparent memory leak on 64bit windows / php / mysql stac Reply with quote

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

PostPosted: Wed 06 Apr '16 20:49    Post subject: Reply with quote

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

PostPosted: Thu 07 Apr '16 13:57    Post subject: Reply with quote

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: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 07 Apr '16 16:26    Post subject: Reply with quote

Which download from windows.php.net did you use?
Back to top
daniel1975



Joined: 05 Feb 2006
Posts: 24
Location: RO, Bucharest

PostPosted: Fri 08 Apr '16 23:46    Post subject: Reply with quote

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

PostPosted: Wed 13 Apr '16 23:25    Post subject: Reply with quote

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: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Apr '16 11:40    Post subject: Reply with quote

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

PostPosted: Wed 20 Apr '16 8:58    Post subject: Reply with quote

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


Reply to topic   Topic: Apparent memory leak on 64bit windows / php / mysql stack View previous topic :: View next topic
Post new topic   Forum Index -> Apache