Reply To: Search is very slow


Ernest Marcinko

After some experimenting I have found the cause of the problem.

There was this image, which is a bit too big:

The search calls the wordpress image library to try to create a smaller crop of the image, but because of the size and type (2.2 MB, png) of the image the PHP memory runs out. I've done some measurements, the memory peaks at around 100MB after wordpress is loaded before the search, and the image library tries to take around 40MB more. The problem is that the memory runs out at 128M. I highly suggest increasing the memory limit from 128MB to at least 512 in the php.ini file if you are planning to use bigger images.

I've tried to switch to the image library that I built as an alternative to the wordpress core one, but still no luck – it uses somewhat less memory, but still not enough unfortunately.

As an alternative, I can turn off the image cropping and caching, but as a result the full sized images will be shown as thumbnails in the results.

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)