fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
134 stars 62 forks source link

Debian php-pecl-memprof .deb not available #220

Closed polytan02 closed 9 years ago

polytan02 commented 9 years ago

no memory prolier as php-pecl-memprof extension was not found

I'm on Debian 7 and Debian 8. Do you know which package to install to have php-pecl-memprof installed ?

The aim is to activate define('LOG_MEMORY_PROFILER', true);

norm2k commented 9 years ago

pecl -d preferred_state=beta install memprof that should get you what you need.

polytan02 commented 9 years ago

Thanks.

On my Debian, I had to do this :

apt-get install php5-dev libjudy-dev

pecl -d preferred_state=beta install memprof

Then add at the end of /etc/php5/fpm/php.ini

extension=memprof.so

And change the parameter in z-push/config.ini

In any case, what is the interest of the option ?

fmbiete commented 9 years ago

Enabling that option will dump a memory profiling after execution. It can help us to find memory leaks so we can use php-fpm without restarting the process after a number of executions.

That's a hard task, so if anyone is willing to help, he's very welcomed!! :laughing:

polytan02 commented 9 years ago

I don't have any issue to help...as long as I understand what to d and how to do it :d

Currently I don't. Would you know what and how to do it ?

fmbiete commented 9 years ago

That only should be used when you think that your installation is leaking memory. The steps should be like this:

  1. Enable the config.php parameter
  2. Run your server as normal
  3. After each php process ends you will have a file ending with a number (process id). Locate the one that interest you.
  4. Open it with KCachegrind (http://kcachegrind.sourceforge.net/html/Home.html)
  5. You will see a lot of info about objects, stacks, classes... Hopefully you will detect where the leak is. BUT this is not easy.
polytan02 commented 9 years ago

Ok, this is way beyond what I can do.

Many thanks for the explainations and support :)