Tracking Memory Usage in PHP

前端 未结 4 977
无人及你
无人及你 2020-11-29 02:15

I\'m trying to track the memory usage of a script that processes URLs. The basic idea is to check that there\'s a reasonable buffer before adding another URL to a cURL multi

4条回答
  •  臣服心动
    2020-11-29 03:13

    Well I have never really had a memory problem with my PHP scripts so I do not think I could be of much help finding the cause of the problem but what I can recomend is that you get a PHP accelerator, you will notice a serious performance increase and memory usage with decline. Here is a list of accelerators and an article comparing a few of them (3x better performance with any of them)

    Wikipedia List

    Benchmark

    The benchmarks are 2 years old but you get the idea of the performance increases.

    If you have to you can also increase you memory limit in PHP if you are still having problems even with the accelerator. Open up your php.ini and find:

    memory_limit = 32M;
    

    and just increase it a little.

提交回复
热议问题