Jump to content

Memory leak


thooom
 Share

Recommended Posts

Hello,

 

I'm using PHP 5.3.3, PS 1.6.0.9 and ebay module 1.9.2. I noticed that when I launch synchronization, server memory usage increase on each iteration and dosen't decrease when I stop the synchro. Then it decrease after many hours, but having thousands of products sometimes I need to restart the server before the complete synchronization, and memory usage fall down again as it should be.

 

Looking at the code, it all seems to happen in EbayRequest.php for the CURL request. Maybe a php bug?

 

Thanks for help

 

Share this post


Link to post
Share on other sites

PHP design to die after all request. So after your request to service is finished memory is cleared. But if you use php-fpm on server side they workers can eat memory and not free it correctly. In your case ebay module eat lot of memory that become "eaten" by php worker. 

Solution for this it's modify php-fpm configuration to restart workers after 300 request.

Settings for this in pool configuration

pm.max_requests = 500

 

So summarise. Curl or some php code that executed for small period can't be reason of eating memory. This is more related to server php-processor.

Share this post


Link to post
Share on other sites

PHP design to die after all request. So after your request to service is finished memory is cleared. But if you use php-fpm on server side they workers can eat memory and not free it correctly. In your case ebay module eat lot of memory that become "eaten" by php worker. 

Solution for this it's modify php-fpm configuration to restart workers after 300 request.

Settings for this in pool configuration

pm.max_requests = 500

 

So summarise. Curl or some php code that executed for small period can't be reason of eating memory. This is more related to server php-processor.

 

Thank you for reply. phpinfo() says Server Api: CGI/FastCGI. Does it mean I'm not using php-fpm? If not, is there another way to check it?

Share this post


Link to post
Share on other sites

Thank you for reply. phpinfo() says Server Api: CGI/FastCGI. Does it mean I'm not using php-fpm? If not, is there another way to check it?

This mean you use phpfpm. Please check

https://www.google.de/webhp?q=php+fastcgi#q=php+fastcgi&start=1

 

In your case better to contact your hosting support.

 

If you have ssh access you can see what run for php by command.

 

ps aux | grep php-fpm

 

will show you workers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More